CSS: Position text in the middle of the page
Try this CSS:
h1 {
left: 0;
line-height: 200px;
margin-top: -100px;
position: absolute;
text-align: center;
top: 50%;
width: 100%;
}
jsFiddle: http://jsfiddle.net/wprw3/
Here's a method using display:flex
:
.container {
height: 100%;
width: 100%;
display: flex;
position: fixed;
align-items: center;
justify-content: center;
}
<div class="container">
<div>centered text!</div>
</div>
View on Codepen
Check Browser Compatability