Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Tabs across with width of the container.

How do I make navigation pan across the whole with of the container? If I have only 4 links across the with of 1000px.

It seems to work with the code below but its not 100%, I have only adjusted the padding for the links and is leaving some space on the right.

topMenu {

background: red;
float: left;
width: 100%;

}

topMenu ul {

margin: 0;
padding: 0;

}

topMenu ul li {

float: left;
font-size: 1.33em;
list-style: none;
font-family: "Verdana", "Arial", Helvetica, sans-serif;
border-right: 2px solid white;
border-left: 2px solid white;
margin: auto;
padding: 0;

}

topMenu a {

background: #000;  
font-size: 12px;
color: #fff;  
display: block;
float: right;
margin: 0;
padding: 8px 107px 8px 106px;
border: 0 10px 0 10px; 
border-color: white;
text-decoration: none;

1 Answer

Give the li elements a width.