使用Viewport创建适合移动设备的版本 [英] Using Viewport to create a mobile friendly version
问题描述
我正在一个网站上工作,但是我也想要一个适合移动设备的版本.我是这个新手.
I'm working on a site, but I want a mobile friendly version aswell. I'm a newbie to this.
有人建议我应该使用以下代码,在这里我找不到很多相关的问题:
Someone suggested I should use the following code, to which I can't find many relating question on here:
<meta name="viewport" content="width=320, initial-scale=1">
问题是我不知道如何实现它,而且我知道不能简单地转换整个页面.
The problem is that I have no idea how to implement it, and I know that cannot simply convert the whole page.
我要的是有关如何实现目标的一些指示.
What I am requesting is some pointers on how I can reach my goal.
推荐答案
http://dev.opera.com/articles/view/an-introduction-to-meta-viewport-and-viewport/ gives you an introduction to the various aspects of the viewport meta tag. For optimizations across a range of screen sizes, you probably want to use <meta name="viewport" content="width=device-width">
in combination with media queries (also covered in the article above).
请注意,您链接到的Element Fusion教程在视口值之间使用分号定界符而不是逗号-这是不正确的.请确保使用逗号,例如您最初的示例:-)
Note that the Element Fusion tutorial you linked to uses semicolon delimiters between viewport values instead of commas - this is not correct. Be sure to use commas, like in your initial example :-)
这篇关于使用Viewport创建适合移动设备的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!