【问题标题】:Viewport tag not working on Chrome视口标签在 Chrome 上不起作用
【发布时间】:2013-03-12 15:47:29
【问题描述】:

我正在使用 Chrome 中的设备指标覆盖来测试响应式网站的较小分辨率(在本例中为 320x480)。

在这种情况下,我的视口元标记对页面没有任何影响。标志会显得很小,我完全看不懂。或多或少,我会说我看到的一切都是 0.5 级的。

这是我的 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>

这在其他人的网站上确实有效....我不知道我做错了什么...

【问题讨论】:

    标签: html responsive-design viewport


    【解决方案1】:

    试试这个代替你的元标记。祝你好运。

    <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" />
    

    【讨论】:

    • 这只是帮助我摆脱了困境。谢谢。
    • 确保在content 中使用逗号而不是分号。大多数浏览器都不会打扰,但 Chrome 会。
    • +1 为您服务。但请更正错字并使用“coma”而不是分号&lt;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" /&gt;
    猜你喜欢
    • 2017-10-28
    • 1970-01-01
    • 2015-01-24
    • 1970-01-01
    • 2017-12-06
    • 1970-01-01
    • 1970-01-01
    • 2018-02-03
    • 2014-07-25
    相关资源
    最近更新 更多