It is easy to implement vertical center of text in CSS. However, if you want to vertically center the text, there are still some tips. After searching online for half a day today, you can find the following method:
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > < Html Xmlns = "Http://www.w3.org/1999/xhtml" > < Head > < Title > Universal vertical center with CSS </ Title > < Style > # Outer { Height : 100px ; Overflow : Hidden ; Position : Relative ; } # Outer { Display : Table ; Position : Static ; } # Middle { Position : Absolute ; Top : 50% ; } /* For explorer only */ # Middle { Display : Table-Cell ; Vertical-align : Middle ; Position : Static ; } # Inner { Position : Relative ; Top : -50% } /* For explorer only */ . Withborder { Border : 1px green solid ; } </ Style > </ Head > < Body > < Div ID = "Outer" Class = "Withborder" > < Div ID = "Middle" > < Div ID = "Inner" > Any text any height any content, everything is vertically centered. </ Div > </ Div > </ Div > </ Body > </ Html >