I have a div element that rotate which contains a text but we see the text in the backface of this div:
div {
position: absolute;
background-color: lightgreen;
height: 240px;
width: 150px;
border-radius: 3px;
transform: rotate3d(-0.3, 1, 0, 30deg);
animation: rotate 1s infinite;
}
@-webkit-keyframes rotate {
100% {
transform: rotate3d(-0.3, 1, 0, 390deg);
}
}
<div>
<p>
A text...
</p>
</div>
So I tried to use the backface-visibility css property on the div itself with hidden as value but then the entire background disappear:
div {
position: absolute;
background-color: lightgreen;
height: 240px;
width: 150px;
border-radius: 3px;
transform: rotate3d(-0.3, 1, 0, 30deg);
animation: rotate 1s infinite;
backface-visibility: hidden;
}
@-webkit-keyframes rotate {
100% {
transform: rotate3d(-0.3, 1, 0, 390deg);
}
}
<div>
<p>
A text...
</p>
</div>
So I tried to just use this property on the text itself by using:
div p {
backface-visibility: hidden;
}
But nothing change and the text is still visible. So is there an simple way to hide this text section (maybe also without an :after element)?