视口标记语法 [英] Viewport Tag Syntax

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

问题描述

我一直在网上寻找,而且我仍然困惑于哪些是有效的,哪些没有。当我使用分号时,我在Chrome上看到错误,但iPhone识别它。逗号也可以正常工作。



半冒号 -



<$ p $我想知道哪一个是合格的写作方式。 p> < meta name =viewportcontent =width = device-width; initial-scale = 1.0; maximum-scale = 1.0; user-scalable = 0; />

逗号 -

 < meta name =viewportcontent =width = device-width,initial-scale = 1.0,maximum-scale = 1.0,user-scalable = 0/> b 


$ b

/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.htmlrel =noreferrer> http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html



我只是寻找正确的解释,为什么我会遇到这个错误,尤其是为什么它会在Chrome上引发错误。



编辑:woops,忘记了代码标签。更新。

解决方案

逗号是视口属性的正确分隔符。 iPhone Safari(以及其他浏览器)可能会更宽容并将分号解析为分隔符,但是您依赖于浏览器的错误处理。


I have been looking on the web and I'm still confused on which works and does not. I see errors on chrome when I use the semi-colon, but the iPhone recognizes it. The comma works also without errors. I'm wondering which one is qualified as the correct way of writing it.

Semi Colons -

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />

Commas -

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" / >

http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html

I'm just looking for a correct interpretation of why I have this error if both work, especially why it throws an error on Chrome.

EDIT: woops, forgot the code tags. updated.

解决方案

Commas are the correct delimiters for viewport properties. iPhone Safari (and other browsers) might be more forgiving and interpret semicolons as delimiters as well, but then you're relying on the browser's error handling.

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

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