0

I know this one has been asked few times already (1, 2), but it seems I'm missing the point as I can't achieve this in my example. Here is the example: jsfiddle Link. Thanx for your help.

HTML:

<li class="imageFrame">
    <a class="nyroModal" rel="gal" href="#photo_3680" title="Take a walk on the wild side ">
        <img class="" src="http://salon-cakovec.fotografija.hr/prijava/upload/thumb/fepessoa_1339763389.jpg" height="120" width="120" alt="Take a walk on the wild side">
    </a>
</li>​

CSS:

.imageFrame {
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    padding: 5px;
    margin: 5px;
    width: 120px;
    height: 120px;
    text-align: center;
    float: left;
    border: 3px solid #EEE;
    background-color: #CCC;
}


.imageFrame img {
    height: auto;
    width: auto;
}
Community
  • 1
  • 1
Nikola
  • 14,888
  • 21
  • 101
  • 165

1 Answers1

2

Check updated fiddle - http://jsfiddle.net/aDVyu/4/

comment - float and add -

display: table-cell;
vertical-align: middle;

Yes! IE7 does not support display: table-cell; property

If you want this to work in IE7 also then you need to use jQuery to calculate height - http://jsfiddle.net/tQBVy/

Dipak
  • 11,930
  • 1
  • 30
  • 31
  • But keep in mind it won't work with IE7- (`table-cell` not supported) – zessx Jun 18 '12 at 08:06
  • ah, float was killing the show for me :/, as I did try display: table-cell; vertical-aling: middle; as it was suggested in the link 1 i referenced. Thanks! – Nikola Jun 18 '12 at 08:11