简体   繁体   中英

Evenly distribute li items, with absolute width

In the footer of a responsive website, I need to evenly distribute some li items.

This is what I want to achieve:

在此处输入图片说明

And this is what I have:

在此处输入图片说明

I would like to avoid setting absolute width for each li, to keep a responsive capability of this part of the website.

What would be the optimal way to proceed?

You could try

text-align:justify;

for your ul element

here is a fiddle

http://jsfiddle.net/89bnF/833/

The effect in your screenshot can be achieved by using a margin:

.bottomMenu li {
    margin-right: 24px;
}

If you want a nice, justified look and you are not concerned with very old browsers, you can use a flex model:

.bottomMenu (
    display: flex;
    justify-content: space-between;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM