Jump to content

Nav Bar Even Distribution


Recommended Posts

Hello All,


I was wondering if anyone had some fluid techniques for nav bars. I want to evenly distribute each li in the nav bar and have them be fluid. Structure like the following:


<nav id="nav" class="width">
   <div id="slide" class="body">
       <ul id="bar">
           <li><a href="#">NEWS</a></li>
           <li><a href="#">SPORTS</a></li>
           <li><a href="#">OPINION</a></li>
           <li><a href="#">LIFESTYLES</a></li>
           <li><a href="#">A&E</a></li>
           <li><a href="#">BLOG</a></li>
           <li><a href="#">ABOUT</a></li>


the width class is 100% and the body is 80% centered with the margin 0px auto. I need to know the padding for each li to make it fluid and evenly distributed through the ul bar.


Thanks in advance!

Link to comment
Share on other sites

Can you post your CSS?


Without seeing it, I'd suggest declaring a text-align: center; on your <ul> (this will make your <li>'s sit in the center of your <ul>)


Give your <li>'s a global padding style of whatever you want, i.e 10px. Declare a text-align: center on your <li>'s too.





Edited by AoTBuNgLe
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.