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

Media Queries / Mobile Design

Hey everyone I recently built a site oacbahamasinc.org I used media queries. When I test the site on my computer it works fine. I adjusts when I resize the screen. However when I open it on my phone I get the regular site.

I am sure that I am missing something here. What do I need to use other than media queries to make my website mobile friendly.

4 Answers

Julian Gutierrez
Julian Gutierrez
19,201 Points

Have you included:

<meta name="viewport" content="width=device-width, initial-scale=1">

Hi Peaches,

You just need to put this code inside your header in the html to make it work:

<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=no"/>

All the best,

Ede

Thank you so much everyone, I will try it out and update you all in a few days.

Just letting you all know that including that 1 line of code allowed my media queries to kick in properly. Thank you all !

and check for elements that might be bigger than your screen. that always breaks the layout! the chrome devtools really help there