Vertical Align Two Headers in Different Sizes - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Header

Description

Vertical Align Two Headers in Different Sizes

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

h1 {<!-- w w  w  . j  a va 2  s.  c o  m-->
   display: inline-block;
   vertical-align: middle;
}
h2
{
   display: inline-block;
   vertical-align: middle;
}


      </style> 
 </head> 
 <body> 
  <div>
    Able was I... 
  </div> 
  <h1>A man a plan</h1> 
  <h2>a canal...Panama!</h2> 
  <div style="clear:both">
    ere I saw Elba 
  </div>  
 </body>
</html>

Related Tutorials