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

Page width

Im wondering how to have my website expand over the whole window, like for this website's header, would i use media queries or could anybody direct me to a place where i can learn? All help would be appreciated:)

4 Answers

like have a navigation bar background expand the length of a web page?

try width: 100%; in your css

yeah you might be talking about a fixed nav bar.... I think bootstrap may have what youre looking for.

If you're looking a 100% width then use width: 100%;

However if it is in a container (say a 960px wrapper) then it will only expand to it's parent. E.g. 100% of 960px is 960 so that will be the width. Another way of achieving this however is by using position: absolute; which takes it OUT of the document flow.

If you're looking at a fixed nav bar then you want to look into position: fixed; but I don't think that is what you are after.

this website is a bootstrap fixed nav header. If you use your developer tools, you can look at the code for the nav bar. You wont be able to use it until you download bootstrap, however. There is a video for it on Treehouse, do a search for bootstrap.