[英]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.