Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这可能吗?
因此,如果我们有一个列表:
代替
项目 1 项目 3
第 2 项 第 4 项
我们想要
项目 1 项目 2
第 3 项 第 4 项
多列布局模块可以做到这一点,还是我最好用老式的浮点数或内联 div 做到这一点?
像这样?
<style> ul {list-style: none;} li {float: left;} li:nth-child(2n+1) {clear: left;} /* 1st of every twos */ </style> <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> <li>item 4</li> </ul>