Vertical Align an element in CSS

Posted by webzide on Stack Overflow See other posts from Stack Overflow or by webzide
Published on 2010-05-07T23:58:52Z Indexed on 2010/05/08 0:08 UTC
Read the original article Hit count: 236

Filed under:
|

Dear experts, I was trying to align an paragraph to the middle of an division element via CSS and I somehow can't get it to work.

 <style type="text/css">
    .wrap{
background:red;
height: 5em;  
     }
     p{
     background:blue; 
        height: 2em; 
vertical-align:middle; 

      }
  </style>


<div class="wrap">
    <p>
    ALIGN TEXT
    </p>
</div>

It doesn't work in IE nor firefox,

© Stack Overflow or respective owner

Related posts about css

Related posts about html