I have lists generated from php that are varying lengths. How could I have the list at a certain height break and start filling a new column rather than remain in one long column?
If lists are no good I would be fine doing it with divs but I can not figure out how to do that eithe开发者_如何学JAVAr.
I would take a look at column-* declarations in CSS3. Be aware that they most likely won't work in IE as Firefox/Webkit browsers require hacks for it to work.
http://www.quirksmode.org/css/multicolumn.html
You would then just set a height to the wrapping div, which is where it will cut off and start a new column. I can't think of a way to do this after a set number of items, unless you add logic in your PHP to start a new column <div>
/<ul>
after X elements. Would even be a better solution.
If order isn't important, you can simulate columns by giving each li
a fixed width and simply make them wrap around (float: left
ought to do it).
Otherwise, you'll have to wait for CSS3 to be finalized and adopted.
精彩评论