
Originally Posted by
liko
In all sites you provided if in #text you remove all line-height and add this :
Css code
Code:
text-align:center;
vertical-align:middle;
it will align the text in center vertically and horizontally.
That won't work I'm afraid as vertical-align (outside of table-cells) only applies to inline elements on the same line. It will not align two or more lines.
For IE8+ you could add an inner span element and turn it into a table-cell element as follows.
Code:
#title {
position:absolute;
height:27px;
background-color:#F4F4F4;
color:#1655A5;
top:0px;
left:0px;
width:197px;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
font-weight:bold;
padding:5px 5px 5px 10px;
display:table;
}
#title span{
display:table-cell;
vertical-align:middle;
}
Code:
<div id="title"><span>Operator name here </span></div>
If you want IE7 and under support then it can be down with a different method using inline-block and another empty element.
Bookmarks