Viewport tag not working on Chrome

前提是你 提交于 2019-11-29 20:46:40

问题


I'm using the device metrics override in Chrome to test a responsive website for smaller resolutions (320x480 in this case).

My viewport meta tag is not making any effect on the page in this case. The logo will appear tiny, and I it's completely unreadable. More or less, I'd say I'm seeing everything in a .5 scale.

Here's the head of my HTML:

<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<link rel="stylesheet" href="css/main.css" />
<link rel="stylesheet" href="css/mediaqueries.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" / >
<!--[if lte IE 8]>
    <style>
    .wrapper {min-width: 960px; padding: 0 10px;}
    .hovertext {background: #ccc;}
    </style>
<![endif]-->

<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.0.6-development-only.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/main.js"></script>

This does work on other people's sites.... I don't know what I'm doing wrong...


回答1:


Try this in place of your meta tag. Good luck.

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densityDpi=device-dpi" />


来源:https://stackoverflow.com/questions/15365750/viewport-tag-not-working-on-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!