[英]How I can do a 2-column list in valid XHTML/CSS?
I have to build a page that has a list that fits in two columns. 我必须构建一个页面,该页面具有适合两列的列表。 This list is generated by PHP so needs to be easy to add inputs.
该列表由PHP生成,因此需要易于添加输入。
It should like to: 它想:
* Lorem Ipsum * Lorem Ipsum
* Lorem Ipsum * Lorem Ipsum
* Lorem Ipsum * Lorem Ipsum
* Lorem Ipsum * Lorem Ipsum
* Lorem Ipsum * Lorem Ipsum
I would like to know if there is some way to generate this with a basic structure of <ul />
and <li />
: 我想知道是否有某种方法可以使用
<ul />
和<li />
的基本结构来生成它:
<ul>
<li>Lorem Ipsum</li>
<li>Lorem Ipsum</li>
<li>Lorem Ipsum</li>
<li>Lorem Ipsum</li>
<li>Lorem Ipsum</li>
</ul>
I need to support major browsers (and IE7, 6 not supported). 我需要支持主要的浏览器(不支持IE7、6)。
Thank you in advance! 先感谢您!
I have found the solution to this: 我找到了解决方案:
ul li {
margin: 0;
padding: 0;
width: 50%;
float: left;
}
You're looking for the CSS3 multicolumn property. 您正在寻找CSS3多栏属性。 Unfortunately, unlike a lot of the cool features that are provided in the CSS3 specs, hardly any browser supports this as of yet.
不幸的是,与CSS3规范中提供的许多出色功能不同,到目前为止,几乎没有任何浏览器支持此功能。 There is a javascript available though that can make it work in most browsers:
虽然有一个javascript可以使它在大多数浏览器中运行:
http://www.alistapart.com/articles/css3multicolumn/ http://www.alistapart.com/articles/css3multicolumn/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.