[英]Why Chrome Developer Tools set such a big viewport size when emulating mobile?
I have a test document as follows: 我有一份测试文件如下:
<html>
<head></head>
<body></body>
</html>
So it's just an empty document. 所以它只是一个空文档。 In normal browser mode, I get an nice empty page, no scrolls.
在普通的浏览器模式下,我得到一个漂亮的空页,没有滚动。
But when I open devtools and turn on mobile emulation (for example, Sony Xperia Z, Z1), I see scroll bars (both horizontal and vertical), and html element size is 980x1742. 但是当我打开devtools并开启移动仿真时(例如,Sony Xperia Z,Z1),我看到滚动条(水平和垂直),html元素大小为980x1742。 Where does this come from?
这是从哪里来的? Shouldn't it be at least zero height?
它不应该至少为零高度?
To make your page the exact size of the screen (no zooming or otherwise), place this in the header: 要使您的页面成为屏幕的确切大小(无缩放或其他),请将其放在标题中:
<meta name="viewport" content="width=device-width, initial-scale=1">
There's some more info about it, as well as additional parameters you may find useful, on Mozilla's developer site here . 这里也有一些关于它的更多信息,以及其他参数,可能对你有用,Mozilla的开发者网站在这里 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.