如何安排许多< div>元素并排,没有包装 [英] How to arrange many <div> elements side by side with no wrap
本文介绍了如何安排许多< div>元素并排,没有包装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在容器div中并排有三个div元素,宽度小于子元素
的宽度。 这里您可以找到案例的小提琴:
我想让容器div水平滚动,以显示其他的孩子。
如何安排孩子不要包装在容器div? c> float:
现在垂直滚动,我想要水平滚动。
解决方案 left 至
display:inline-block;
并将 white-space:nowrap
容器。 There are three div elements side by side in a container div, with smaller width than children total width. Here you can find the Fiddle of the case:
I want to make container div scroll horizontally in order to show other children.
How can I arrange children not to wrap inside container div? It scroll vertically now, I want it to scroll horizontally.
解决方案
Change float: left
to display: inline-block;
and add white-space: nowrap
to the container.
这篇关于如何安排许多< div>元素并排,没有包装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文