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 trialBrandon Brigham
3,716 PointsMobile version of site looks too large
Hello everyone,
So if you check out a site I'm working on on your smartphone @ http://www.avlsounddesign.com/
and click on 'Weddings' and then on 'Events' you will notice that the size of the page is enlarged.
Anyone know how to make it just look normal? Normal meaning it looks as it does on a desktop but just smartphone-size...
1 Answer
Tom Bedford
15,645 PointsI think you're asking how to get a zoomed out view of the desktop site on a phone.
If that's right, remove this line from the <head>
:
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
Brandon Brigham
3,716 PointsBrandon Brigham
3,716 PointsThank you Tom! What about the Wedding page and Events page on mobile? I looked at the headers on those pages and couldn't find the code you told me to delete there.... Any ideas?
Tom Bedford
15,645 PointsTom Bedford
15,645 PointsIt's on line 5 of the wedding and events pages:
<meta name="viewport" content="width=device-width" />
Brandon Brigham
3,716 PointsBrandon Brigham
3,716 PointsTom - I tried deleting that line of code off the header.php file of the Weddings page but nothing changed. Am I looking at the wrong file?
Tom Bedford
15,645 PointsTom Bedford
15,645 PointsIf I look at the source of the page (usually right click -> "view source") I can still see it there on line 5 after clearing the cache and refreshing. It's either not removed, the new file isn't uploaded or it's cached on your server and the old file is still being displayed. If you can make that line disappear on the live site when viewing the page source then the page should display as you're wanting it to.
Brandon Brigham
3,716 PointsBrandon Brigham
3,716 PointsThanks again Tom but I did that on the Weddings page and cleared my browser but it's still not coming out right on a mobile device. You can check the source yourself again and that line of code has been taken off. Not sure what else to do
Tom Bedford
15,645 PointsTom Bedford
15,645 PointsLooking again you also have this on line 134:
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
Just delete every line with "viewport" in it.
Brandon Brigham
3,716 PointsBrandon Brigham
3,716 PointsTom!! You're the man!!