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 Basics (2014) Enhancing the Design With CSS Adjusting the Layout with Media Queries

.wildlife in media queries isn't working properly, still too narrow when viewing on phone devices.

/* Media Queries -------------------- */

@media (max-width: 1024px) { .primary.content, .secondary-content { width: 90%; } .wildlife { padding: 10% 12%; margin: 50px 0 20px; } }

@media (max-width: 768px) { .primary.content, .secondary-content { width: 100%; padding: 20px; border-top: none; }

.main-header { max-height: 380px; padding: 50px 25px 0; }

.title { font-size: 1.3rem; border:none; } h1 { font-size: 5rem; line-height:1.1; } .arrow { display:none; } .intro { font-size: 1rem; } .resorts, .tips { float: none; width: 100%; } .main-footer { padding: 20px 0; } }

So this is what I have but when going into developer tools and using the simulator to view the pages on mobile devices my .wildlife class is still too narrow, not responsive. Everything else is fine...

1 Answer

You can only put media queries at the end of the script.

It is required to do so, not only conventional. If you don't, the page won't be responsive as you'd expect.

Move all of the media queries to the bottom of the file and it should work :smiley:

I hope this helps :grin:

Happy coding! :tada: :confetti_ball: :tada:

:dizzy: ~Alex :dizzy: