Posted By

coreypurcell on 07/30/09


Tagged

css design vertical centering


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vali29


Vertical and Horizontal Centering with CSS


 / Published in: CSS
 

URL: http://valums.com/vertical/

  1. .center {
  2. position: absolute;
  3. top:0; right:0; bottom:0; left:0;
  4. margin: auto;
  5.  
  6. left:expression(this.parentNode.clientWidth/2 - this.clientWidth/2 " px");
  7. top:expression(this.parentNode.clientHeight/2 - this.clientHeight/2 " px");
  8.  
  9. width: 60%;
  10. height: 60%;
  11. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: coreypurcell on July 30, 2009

Expression makes it work in IE6/IE7

You need to login to post a comment.