Return to Snippet

Revision: 41177
at February 14, 2011 03:04 by alp


Initial Code
<figure class='logo'>
    <span></span>
    <img class='photo'/>
</figure>

.logo {
  display: block;
  text-align: center;
  display: block;
  text-align: center;
  vertical-align: middle;
  border: 4px solid #dddddd;
  padding: 4px;
  height: 74px;
  width: 74px; }
  .logo * {
    display: inline-block;
    height: 100%;
    vertical-align: middle; }
    .logo .photo {
    height: auto;
    width: auto;
    max-width: 100%;
    max-height: 100%; }

Initial URL
http://snippets.dzone.com/posts/show/12757

Initial Description
this centers an image of unknown size vertically and horizontally within a box

Initial Title
Cross Browser Vertically and Horizontally Centered Images in CSS without Tables

Initial Tags
images

Initial Language
CSS