I have a page .xhtml
and the first element to be placed is a div
( content ) and I set it to a top margin ( margin-top
) of 30% p>
Supposedly, this percentage should be taken from the height of my screen, in my case I have a screen of 1600 × 795 and the 30% would be taken from the 795px.
See what happens:
#content
{
width: 300px;
height: 200px;
margin: 0 auto;
margin-top: 50%;
background: red;
}
<div id="content">
</div>
In the example I put 50% of margin-top
to pass the perception of what happens. It should be 50% of the top plus it seems to have gone down a lot more.