You can use a relative sizing property that gets inherited by child elements, instead of using scale(...)
in the parallax's transform
. For example, scale up font-size
and omit scale(...)
:
html {
overflow-y: hidden;
}
body {
height: 100vh;
overflow-y: auto;
perspective: 1px;
}
.large {
font-size: 3em;
font-weight: bold;
}
.parallax.item {
font-size: 2em; /* scale with a relative sizing that gets inherited by child elements instead of using `scale()` in the `transform` property below */
position: absolute;
transform: translateZ(-1px); /* notice no scale() */
}
<html>
<body>
<div class="parallax item">
<div class="large">Hello!</div>
</div>
<div class="large">Hello!!</div>
<div class="large">Hello!!</div>
<div class="large">Hello!!</div>
<div class="large">Hello!!</div>
<div class="large">Hello!!</div>
<div class="large">Hello!!</div>
<div class="large">Hello!!</div>
<div class="large">Hello!!</div>
<div class="large">Hello!!</div>
<div class="large">Hello!!</div>
<div class="large">Hello!!</div>
<div class="large">Hello!!</div>
<div class="large">Hello!!</div>
<div class="large">Hello!!</div>
<div class="large">Hello!!</div>
<div class="large">Hello!!</div>
</body>
</html>
Now you've got the opposite problem, at least on Chrome: the text needs some antialiasing :P