Maxim Nikitin
List to columns July 27, 2009 |
|
Task: | to break down a list into columns. |
||
The easiest way would be to work with each column invididually using :nth-child(n)
CSS selector, but the number of selectors will grow with the number of columns. Besides, this solution will not work with older browsers. Thus, we’ll use display:inline-block
and vertical-align:top
for <li>
and a “specific” solution for IE, as usual.
Drawbacks. In browsers that don’t understand inline-block users will be able to follow a link by clicking empty space.
Note. The solution is to be used when changing HTML code is not an option.
|
|