Posted By

lamebollock on 05/16/11


Tagged

css html xhtml webdesign CSS3 snippets resources html5


Versions (?)

Vertical Align Center


 / Published in: CSS
 

URL: http://designshack.co.uk/articles/css/html5-and-css3-snippets-every-web-developer-show-know/

It’s a pretty simple task to horizontally center any part of your web page. This practice has gone on for years, and CSS has made things much easier. However vertical alignments have always caused problems for web developers. Except with the code below it’s a peice of cake! The vertical-align attribute will work wonders and doesn’t require any extra code for perfect vertical alignment.

  1. .vcontainer {
  2. min-height: 10em;
  3. display: table-cell;
  4. vertical-align: middle;
  5. }

Report this snippet  

You need to login to post a comment.