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

Ashley Van Laer
Ashley Van Laer
6,662 Points

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

If I type this <meta name="viewport" content="width=device-width"> it does opposite thing, the website isn't going to mobile and when i cut this line away, it does go to mobile, why is this?

Eion Schreiber
Eion Schreiber
6,963 Points

I don't know if it was the same problem I had, but the screen dimensions were different for the Iphone for me so I needed to adjust the pixel value for the media tag to make it fit nicer. Before it was super zoomed in like I didn't have the meta tag in.

1 Answer

I'm not sure of your issue, that meta tag should work. Here is a short blog post about this meta tag, I hope it helps:

CSS Tricks meta tag

Deigan Millikin
Deigan Millikin
7,870 Points

Thanks! This meta tag worked for me:

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