Vertically center text in a table cell - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

Vertically center text in a table cell

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <style>
h1
 {
   font-family:Arial;
   font-size:51px;
   color:Chartreuse;
   display:table-cell;
   padding:100px;
   vertical-align:middle;<!-- w ww .j ava2s . com-->
   position:relative;
   right:31%;
}
</style> 
 </head> 
 <body translate="no"> 
  <table id="intestazione" border="1"> 
   <tbody> 
    <tr> 
     <td class="centerV"> <h1>Lore</h1> </td> 
     <td> <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> </td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials