I've got a background image (480x360) with two bars (100% width, 20px high) on top, one at the top the other at the bottom. Note that the bars go on top of the image, so they don't add to its size. The end result it's still 480x360.
The issue I'm having is vertical centering the text.
I've searched (links below) and tried several different methods but nothing seems to work.
How do I vertically center text with CSS?
Vertically align text in a div
Absolute Horizontal And Vertical Centering In CSS
It's a single line of text, shouldn't be that hard... I'm probably making some n00b mistake.
It's really important that the text is properlly centered, not just kinda centered...
Can somebody give me a hand? Thanks.
HTML:
<div id="panel4" class="panels" style="cursor: move; z-index: 48">
<div class="title">TITLE | THIS IS THE TITLE</div>
<div id="picture4"><img src="http://i.imgur.com/fbEGCcY.png" width="480" height="360"></div>
<div class="footer">FOOTER | THIS IS THE FOOTER</div>
</div>
CSS:
.panels {
position: absolute;
}
#panel4 {
display: inline-block;
position: relative;
}
.title {
position: absolute;
font-family: Monaco;
font-size: 10px;
line-height: 20px;
text-align: left;
height: 20px;
color: #fff;
background: #000000;
width: 100%;
text-indent: 6px;
}
.footer {
position: absolute;
font-family: Monaco;
font-size: 10px;
line-height: 20px;
text-align: right;
bottom: 0;
color: #fff;
background: #000000;
width: 100%;
}