Return to Snippet

Revision: 10052
at December 5, 2008 00:28 by eugegim


Initial Code
/* This will horizontally and vertically center an element, but
   requires that the height and width of it are known */
.centered
{
  width:16px;
  height:16px;
  position:absolute;
  top:50%; 
  left:50%;
  margin-left:-8px;
  margin-top:-8px;
 }

Initial URL
http://www.dezinerfolio.com/2007/05/02/the-simplest-way-to-horizontally-and-vertically-center-a-div/

Initial Description

                                

Initial Title
CSS Horizontally and Vertically Center Element

Initial Tags
css, textmate, center

Initial Language
CSS