The layout of the mobile end, the width is tripled, why the height is also tripled?

question:

when doing Mobile layout , you want to achieve a bottom div, with a horizontal width that is three times the width of the page viewport in the landscape state. Now, after expanding the width, the height is also increased by three times. Why is that?

Code

html
<body>
    <div class="wrap"></div>
</body>
html, body {
    width: 100%;
    height: 100%;
}

.wrap {
    width: 300%;
    height: 100%;
    background: rgba(222, 123, 32, 0.4);
}

can solve the problem from the max-height attribute
set the maximum height to an absolute value instead of a percentage unit


No, your code is full?


Does

have content elements that cause this? Consider using units such as vw and vh

.
100%
    300%
        900%
The code posted by

will not cause the height to triple. In addition, percentage is not recommended for mobile devices. Personally, I think rem is better as a unit

.
Menu