I'm trying to create a button that is centered on the screen with text aligned vertically within the button. I want to achieve this using CSS only and restrict the usage of percentages only. Here's what I have so far:
Check out my code snippet here
HTML
<div id="outer">
<div id="button">
button text
</div>
</div>
CSS
body {
margin : 0px;
}
#outer {
position : absolute;
width : 100%;
height : 100%;
background-color : #123456;
text-align: center;
}
#outer:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
}
#button {
height : 50%;
width : 50%;
background-color : #FFFFFF;
display: inline-block;
vertical-align: middle;
}