问题
I am designing my site (danielrojas.net) with Bootstrap and have created a separate layout for the XS viewports. It works beautifully when I resize my desktop browser (Chrome) and when I try it on Responsinator.com or similar.
However, on my actual Android phone and tablet (both using Chrome, tested using the built-in browser as well), the standard version is shown, no matter what. I have included the magic viewport META tag:
<meta name="viewport" content="width=device-width, initial-scale=1">
To no avail. I am using a customized Bootstrap CSS, but even loading the official one, the same error remains.
Other sites (e.g. getbootstrap.com) work fine on both devices. What am I missing?
Thanks in advance!
回答1:
You are right that you have included <meta> tag. But it is in the frame.
By inspecting your code, Its not there in the main <head>. So Include it in that part also.
<meta name="viewport" content="width=device-width, initial-scale=1">
I'm also not sure, responsive will work on iframe, You should avoid using iframe if its not working.
来源:https://stackoverflow.com/questions/20883810/bootstrap-xs-version-not-working-on-phone-and-tablet