Question

I created this website with the original intention of having it be mobile. However I've had to take that function out and for the time being just wanted to have it so when you visit the site on a mobile device you just see the website as you would see on the screen. Not mobile friendly as you would want it to be but zoomed out so you can see the whole thing.

I've already placed in the code to make it behave the way I'd like it to but something is happening and it's not working. Ive looked into the HTML 5 shim and other options for the viewport but I can't figure it out.

I've tried a few different variations of the viewport tag

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

This is what the website looks like right now on mobile devices

enter image description here

This is what I was hoping to make it look like

like this screenshot

Can you see what I'm missing?

Was it helpful?

Solution

In your case you should not use any of the suggested meta viewport tags. If you leave the page without any meta viewport tags you should get the desired result in most mobile browsers.

You could add <meta name="viewport" content="width=980"> to tell the browser that you content is 980 px, if that is the case. You seem to have a 960 px wide page but it may look nicer to have some spacing on the sides.

I find this to be a nice article to explain the meta viewport tag

And this is another article about using the meta viewport tag for non-responsive pages

The meta viewport tags that you have tried tells the browser a few different things:


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

This tells the browser that content width should fit in the device width. In order to use this successfully your page width should be adjustable to the device.


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

This tells the browser that it should zoom the page so that 1 CSS pixel from the page equals 1 viewport pixel on the screen (not physical pixels on e.g. Retina displays). This results in your page being zoomed in as it is wider then a normal mobile screen. Maximum-scale also tells the browser not to let you zoom the page any further than that.


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

This tells the browser that the content is 500 px wide and that you should zoom the page.

OTHER TIPS

I didn't find a css for mobile devices in your themes style.css file. Please write some css for various device like android, iphone, ipad, tablet pc etc.

Example:

* @media Rule */
@media all and (max-width: 1024px) {here is your css code}

@media all and (min-width: 800px) and (max-width: 1024px) {here is your css code}

@media all and (min-width: 320px) and (max-width: 780px) {here is your css code}

I think it will help you to understand responsive css design properly.

Thanks

If you want it to looked zoom out, then remove the viewport restrictions. It is limiting your field of vision and preventing it from sizing your site correctly.

You should only use the mobile viewport if you are reorienting your content based on screen resolution, like the previous example for responsive design.

I think you want the look of website in mobile same as you look in the Desktop. as i can see the screeshot you have provided. For that REMOVE the Viewport code which you have putted in header. Also be sure of if some tags are not correctly closed. it might be cause of the issue.

Try only one of this Meta Viewports each time, remove the others.

Try this first: <meta name="viewport" content="width=device-width" />

Add this in your body tag:

body {min-width: 1024px;}

Should not effect your meta or media queries with this, but this meta as mentioned is a great one:

<meta name="viewport" content="width=device-width" /> 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top