Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sitemap in footer CSS to align/float li elements

Have a look at the following jsFiddle:

http://jsfiddle.net/DNB9T/

how would you float the different ul li elements so they line up beside each other them move to the next line when they hit the right boundary?

like image 327
Burt Avatar asked Dec 07 '25 06:12

Burt


2 Answers

Not entirely sure what you want to do, but you could do something like this

ul.sitemap > li{
    float:left;
    margin:1em;
    min-height:160px;
}

Example: http://jsfiddle.net/DNB9T/5/

Basically, float only direct children (first lis) of the ul.sitemap.

Add a margin to space them out.

Give it a min-height so the floated elements clear each other. I picked 160px, you may need to adjust.

like image 158
Jason Gennaro Avatar answered Dec 08 '25 21:12

Jason Gennaro


Use display:inline-block;

.sitemap ul li{
    display:inline-block;
}

Working demo

like image 42
ShankarSangoli Avatar answered Dec 08 '25 22:12

ShankarSangoli



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!