简体   繁体   English

元视口:width = device-width或initial-scale = 1或两者

[英]Meta viewport : width=device-width or initial-scale=1 or both

For a fully responsive web design, which one of the following meta viewport declaration should I use : 对于完全响应的Web设计,我应使用以下meta视口声明之一:

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

I would like the design to fit the screen after rotating the device. 旋转设备后,我希望设计适合屏幕。

Personally, I would use: 就个人而言,我将使用:

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

https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag

The width property controls the size of the viewport. width属性控制视口的大小。 It can be set to a specific number of pixels like width=600 or to the special value device-width value which is the width of the screen in CSS pixels at a scale of 100%. 可以将其设置为特定的像素数,例如width = 600或特殊值device-width值,该值是CSS像素的屏幕宽度,缩放比例为100%。 (There are corresponding height and device-height values, which may be useful for pages with elements that change size or position based on the viewport height.) (有相应的height和device-height值,这对于包含根据视口高度更改大小或位置的元素的页面可能有用。)

The initial-scale property controls the zoom level when the page is first loaded. 初始缩放属性控制页面首次加载时的缩放级别。 The maximum-scale, minimum-scale, and user-scalable properties control how users are allowed to zoom the page in or out 最大比例,最小比例和用户可缩放属性控制如何允许用户放大或缩小页面

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 <meta name=“viewport” content=“width=device-width, initial-scale=0” />不工作 - <meta name=“viewport” content=“width=device-width, initial-scale=0” /> not working 这个标签是什么(<meta name="“viewport”" content="“width=device-width," initial-scale="1”"> ) 做? - What does this tag (<meta name=“viewport” content=“width=device-width, initial-scale=1”>) do? 视口宽度=设备宽度,初始比例= 1,没有给我全宽度 - Viewport width=device-width, initial-scale=1 not giving me full width width =设备宽度是否与初始比例= 1一致? - Is width=device-width redundant alongside initial-scale=1? HTML 页面上的表格比 div 使用更多的宽度<viewport "width=device-width initial-scale=1.0"> - Table on HTML page takes much more width than div with using <viewport "width=device-width initial-scale=1.0"> 使用视口width = device-width,initial-scale = 1,maximum-scale = 1不能使我的页面适合我的手机屏幕 - Using viewport width=device-width, initial-scale=1, maximum-scale=1 doesnt fit my page to my phone screen 元视口:不能将“ width = 640”与“ initial-scale = 1.0”一起使用吗? - meta viewport: can not use “width=640” with “initial-scale=1.0”? 视口元标记用于固定宽度,但缩放到设备宽度 - Viewport meta tag for fixed width but scaled to device-width 元标记“viewport”content =“width = device-width”不起作用 - meta tag “viewport” content=“width=device-width” not working iPhone视口元标记width = device-width不起作用 - iPhone viewport meta tag width=device-width not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM