Styling a header with left/right elements
by audetwebdesign
HTML
<div class="parent">
<div class="left">
Blah left
</div>
<div class="right">
Blah right
</div>
</div>
CSS
html, body {
height: 100%;
width: 100%;
font-size: 13px;
}
.parent {
background-color: grey;
height: 20%;
line-height: 1.6em;
font-size: 1.6em;
min-height: 1.6em;
position: relative;
}
.left, .right {
position: absolute;
top: 50%;
margin-top: -0.8em;
}
.left {
background-color: yellow;
padding-left: 20px;
left: 0;
}
.right {
background-color: red;
padding-right: 20px;
right: 0;
}