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 Framework Basics Build a Website with Bootstrap Building the Navbar

How do you set the max width to 1000px?

I want to set my bootstrap website to max 1000px. Where do I set that?

You could do it like this:

body { max-width: 1000px;}

or

html { max-width: 1000px; }

Thanks. Will this affect the media queries?

1 Answer

If you put this rule at the top, before your media queries, it will hold as a rule through all media queries unless you change the max-width value for the same element in a different media query.

For example

body {
max-width: 1000px;
}

@media screen and (max-width: 800px) {

body {
max-width: 600px;
}

}

This means the max width of the body with only change if the screen size is 800px or less.