Vertical Centering with CSS


/ Published in: CSS
Save to your folder(s)

works in IE6/IE7 with the css expression.


Copy this code and paste it in your HTML
  1. .center {
  2. position: absolute;
  3. top:0; bottom:0;
  4. margin: auto 0;
  5. top:expression(this.parentNode.clientHeight/2 - this.clientHeight/2 + " px");
  6. height: 60%;
  7. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.