Home  >  Article  >  Web Front-end  >  一个大div中有多个div,如何使这些div在同一行显示,并且溢出后产生滚动条而不换行呢_html/css_WEB-ITnose

一个大div中有多个div,如何使这些div在同一行显示,并且溢出后产生滚动条而不换行呢_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:15:112912browse


如题,当里面所有div宽度超过外面div宽度后,产生一个滚动条显示,而不是换行显示。试过用display:inline-flex,但是在ie下不起作用,求助


回复讨论(解决方案)

<style type="text/css">.mt {	width: 600px;	height: 200px;	overflow: auto;}.mk {	white-space: nowrap;}.mj {	width: 150px;	height: 150px;	border: 1px solid #999;	display: inline-block;}</style></head><body><div class="mt">	<div class="mk">		<div class="mj"></div><div class="mj"></div><div class="mj"></div><div class="mj"></div><div class="mj"></div><div class="mj"></div><div class="mj"></div><div class="mj"></div><div class="mj"></div>	</div></div>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn