问题描述
我一直在网上寻找,而且我仍然困惑于哪些是有效的,哪些没有。当我使用分号时,我在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" / >
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.
这篇关于视口标记语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!