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 CSS Layout Basics Getting Started with CSS Layout Using a Mobile First Approach

content isn't centered, I don't know why?

my site does not look like his. It stays justified to the left, and is not centered and 'fluid' when I change browser width.

here is my css code:

/* ================================= Base Element Styles ==================================== */

  • { box-sizing: border-box; }

body { line-height: 1.6; color: #3a3a3a; }

a { color: #fff; text-decoration: none; }

/* ================================= Base Layout Styles ==================================== */

/* ---- Navigation ---- */

.name { margin: 0; }

/* ---- Layout Containers ---- */

.container { padding-left: 1em; padding-right: 1em; }

.main-header { background: #3acec2; padding: 1em 0; }

.main-footer { text-align:center; padding: 2em 0; background: #d9e4ea; }

/* ---- Page Elements ---- */

/* ================================= Media Queries ==================================== */

@media (min-width: 769 px) { .container { width: 70%; max-width: 1000px; margin: 0 auto; } }

1 Answer

Gergely Bocz
Gergely Bocz
14,244 Points

Hi Amy!

There is a small typo in your media query. There is an unneeded space between 769 and px. This makes the media query invalid. In the dev tools you can check that there is no media query rule!

Your media query condition should look like this:

@media (min-width: 769px)

and NOT like this:

@media (min-width: 769 px)

As a side note: I think the header looks nicer, if there is a small padding on the sides, so i would change the heading's padding to this:

.main-header { background: #3acec2; padding: 1em; }

I hope i could help!

Good luck!