Home › Forums › CSS › How to y(vertically) center body. › Re: How to y(vertically) center body.
May 30, 2013 at 2:48 pm
#137092
BaliBalo
Participant
If you does not mind targetting quite modern browsers only you can use pseudo elements:
html, body { height: 100%; }
body { text-align: center; }
body::before
{
content: ”;
display: inline-block;
height: 100%;
vertical-align: middle;
}
#content
{
display: inline-block;
}