Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorbrunogama
    • CommentTimeSep 25th 2009
     permalink
    Hello people, I am trying to align only the images on the center of my list item, any suggestion?

    the code:
    <style type="text/css" media="screen">
    <!--
    html, body { height: 100%; width: 100%; }
    #wrapper {
    width: 800px;
    margin: 0 auto;
    border: 1px solid yellow;
    display: table;
    }
    ul {
    border: 1px solid red;
    margin: 0 auto;
    width: 660px;
    display: table;
    }
    ul li {
    display: table;
    margin: 0 auto;
    float: left;
    border: 1px solid green;
    width: 150px;
    padding:20px;
    }
    ul li img {
    margin: 10px auto;
    background: #fff;
    padding: 4px;
    border: 1px solid #ddd;
    }
    strong,small { display: block; }
    -->
    </style>
    <div id="wrapper">
    <ul>
    <li>
    <strong>loren ipsum</strong>
    <img src="mf.png" alt="" />
    <small>Legenda</small>
    <a href="#" title="">
    more.
    </a>
    </li>
    <li>
    <strong>Teste</strong>
    <img src="mf2.png" alt="" />
    <small>Legenda</small>
    <a href="#" title="">
    more.
    </a>
    </li>
    <li>
    <strong>Teste</strong>
    <img src="mf3.png" alt="" />
    <small>Legenda</small>
    <a href="#" title="">
    more.
    </a>
    </li>
    </ul>
    </div>

    I am using the eric meyer reset css.
    • CommentAuthorsubinmk
    • CommentTimeOct 7th 2009
     permalink
    I am also interested to see if there a straight forward solution to align images vertically center.
    for horizontal centering enclose the image inside a container div and set its width to 100% and text-align to center.

    .ImageContainer{
    width: 100%;
    text-align: center;
    }

    vertical centering.. get the maximum height of the image in the list and use the same height for for all the images when you crop it. I mean increase the canvas size accordingly.
Add your comments
    Username Password
  • Format comments as (Help)