Having the following HTML
<div class="child-of-body">
This is a text
</div>
and the following CSS
.child-of-body {
position: absolute;
top: 10%;
}
I can set the top
value of the selected elements.
I see that 10%
is computed based on the parent height.
How can I set the top
property in percent values based on the parent width?
I know that is possible via JavaScript, but would it be possible with CSS only?