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
jose macedo
6,041 Pointscss help
how do I stretch my list item's background all the way across???
https://w.trhou.se/le5e99f43o https://w.trhou.se/le5e99f43o https://w.trhou.se/le5e99f43o
3 Answers
Matt Laws
Front End Web Development Techdegree Student 24,108 PointsHi Jose,
You are declaring width: 100% on the li a selector. If you remove this value then the a link elements will on take up as much width they need. When you have done this you can declare nav ul li {float: left}. The other issue I can see from this is your header is displaying the full width of the view port so you will have to solve this issue if you want the nav to align next to the h1.
Hope this helps,
Matt
Dor Sarel
9,987 PointsHi, if i understood what you meant, you can add to your CSS file the following properties:
ul {
width: 100%;
}
ul a {
display: block;
}
it should stretch the background of the list item while hover over it.
Aurelian Spodarec
10,801 PointsTo stretch a background you can use width 100%, but thats not that nice, you can try background-attachment: fixed; for a parallax effect, but i think what you mean is to have a background-size: cover;
If thats what you mean.