视口标记不适用于Chrome [英] Viewport tag not working on Chrome

查看:97
本文介绍了视口标记不适用于Chrome的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Chrome中使用设备指标覆盖来测试响应式网站的较小分辨率(本例中为320x480)。我的视口meta标记未制作在这种情况下对页面有任何影响。该徽标将显得很小,而且它完全不可读。或多或少,我会说我看到了0.5级的所有东西。



这是我的HTML的头部:

 <!DOCTYPE html> 
< html>
< head>
< title>文件的标题< / title>
< link rel =stylesheethref =css / main.css/>
< link rel =stylesheethref =css / mediaqueries.css/>
< meta name =viewportcontent =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 / javascriptsrc =http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.0.6-development-only.js><< ; /脚本>
< script src =http://code.jquery.com/jquery-1.9.1.min.js>< / script>
< script type =text / javascriptsrc =js / main.js>< / script>

这对其他人的网站有效......我不知道我在做什么错误...

解决方案

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

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


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...

解决方案

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

这篇关于视口标记不适用于Chrome的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆