snarkyazoid snarkyazoid - 1 year ago 123
CSS Question

CSS: Position text in the middle of the page

I would like to position a

in the middle of any user's page. I have been searching the internet and they all position it in the incorrect place. Thank you!

UPDATE: I mean vertical and horizontal! In the exact middle!

ALSO: There is nothing else on the page.

Answer Source

Try this CSS:

h1 {
    left: 0;
    line-height: 200px;
    margin: auto;
    margin-top: -100px;
    position: absolute;
    top: 50%;
    width: 100%;


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download