简体   繁体   English

全宽左对齐列表

[英]Full width left-aligned list

Is it possible to stretch and unordered list to fill the full page-width; 是否可以拉伸无序列表以填充整个页面宽度; floating list-items (left) inside of it, without list-items getting clipped if they overflow (hidden) the unordered list? 浮动列表项(左侧)在其中,如果列表项溢出(隐藏)无序列表,则列表项不会被裁剪吗?

If I simply do overflow: none; 如果我只是overflow: none; on the unordered list, whatever list-items are inside, which wont fit a 100 percent, are not shown. 在无序列表上,其中的任何列表项(不适合100%)都不会显示。


This is what I want... 这就是我要的...

http://roosteronacid.com/stackoverflow.png http://roosteronacid.com/stackoverflow.png

Notice that the first and third list-items are shown, even if the unordered list isn't able to show/house them in their full width. 请注意,即使未排序的列表无法以完整宽度显示/容纳它们,也会显示第一个和第三个列表项。

You should set ul to display: table, and li to table-cell. 您应该将ul设置为display:table,将li设置为table-cell。 Here is example: http://jsfiddle.net/simoncereska/4w92q/ 例如: http : //jsfiddle.net/simoncereska/4w92q/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM