It seems to me that Chrome (in contrast to for example Firefox) automatically scales down certain html-content when using the developer tools' mobile view:
Take this minimal example:
<html>
<head>
<style>
html {
height: 100%;
}
body {
height: 100%;
margin: 0;
font-size: 40px;
}
.test {
background-color: lime;
height: 100px;
padding: 20px;
}
</style>
</head>
<body>
<div class="test">Test Test Test</div>
</body>
</html>
For me, when going into mobile view, the green divs' size and font-size is scaled relatively to the window width. However, I would expect it to have a constant height of 100px
. In normal view, everything is as expected, no scaling.
I have recorded this behavior in this gif: Chrome Resizing
Do I have a fundamental misunderstanding of css or is this a special behavior by Chrome? How should I create divs of constant height, so I can work with them in Chrome? Thank you!