Reputation: 27190
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. Where does this come from? Shouldn't it be at least zero height?
Upvotes: 3
Views: 2153
Reputation: 167
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.
Upvotes: 5
Reputation: 358
I had to do:
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
Upvotes: 2