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 How to Make a Website Sharing a Website Upload the Website

Heather Woods
Heather Woods
5,330 Points

The mobile version of my site on my phone looks the same as the desktop version.

When I resize my browser window on my laptop the layout of the page changes as it's supposed to. When I go to my site on my cell phone, It has the full screen desktop version. What's the problem?

2 Answers

Cat Carbonell
PLUS
Cat Carbonell
Courses Plus Student 8,899 Points

Have you tried utilizing media queries in your CSS? You might also need to add a viewport meta tag in the head of your HTML.

<meta name="viewport" content="width=device-width">

If you are using a fixed width for the container : eg width:1000px; then this wont work. Try make it a percentage instead. eg: width: 100%;

next make sure you have the viewport meta tag included, heres one straight from bootstrap.

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

The user scalable part helps prevent users from "pinching" their screen to zoom in and out whilst viewing your site.

Hope this helps!

  • Mike