Vertically align div for unknown fixed size of the div - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Width

Description

Vertically align div for unknown fixed size of the div

Demo Code

ResultView the demo in separate window

<html>
 <head></head> 
 <body style="width:50%; height: 50%;"> 
  <div style="display:block; display:inline-block; layout-grid:line;
     text-align:center; vertical-align:bottom;
     padding: 50% 0 50% 0">
    test <!--from  w w w  .  ja  va 2  s. c  o  m-->
  </div>  
 </body>
</html>

Related Tutorials