Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is this possible with lists?

I'm wondering if its possible to make a list like this: make list like this

Or should I just use divs to accomplish the same thing?

like image 298
Meisam Mulla Avatar asked Dec 05 '25 02:12

Meisam Mulla


1 Answers

It is possbile with pure CSS (floats) to get a list like:

LI1    LI2
LI3    LI4
LI5    LI6


but to get:

LI1    LI4
LI2    LI5
LI3    LI6

you'd need to use javascript or 2 lists with css styling. (EDIT: or as another answer by cale_b mentions, for modern browsers you could use column-count)

the css for my first scenario would look something like this:

ul { width:400px; overflow:hidden; margin:0; padding:0; }
li { width:200px; float:left; margin:0; padding:0; }

adjust your widths, margins and paddings to your liking of course

like image 161
Darko Z Avatar answered Dec 07 '25 19:12

Darko Z



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!