Possible Duplicate:
What's The Best Way of Centering a Div Vertically with CSS
.title_text_only{
position:absolute;
width:100%;
display:none;
z-index:9;
top:50%;
bottom:50%;
text-align:center;
color:#fff;
font-size:18px;
text-shadow: 1px 1px 1px #666;
}
Right now, it doesn’t seem to work. top 50% doesn’t center it vertically. It’s a little to the bottom. It’s as if the top border is 50%.
If you can specify the height of the box, you can use
margin-top: -[height / 2]px(fill in[height / 2]and note that most browsers will round fractional pixels up at 100% zoom).If you can specify the height of its parent, you can do something like this:
If the content of the child is expected to wrap onto multiple lines, you can wrap it in a sub-child that resets the
line-height.