<div> <img src="placeholder.gif" width="70" height="120" /> </div>
<div> <img src="placeholder.gif" width="90" height="80" /> </div>
<div> <img src="placeholder.gif" width="70" height="120" /> </div>
div {
float: left;
text-align: center;
width: 150px;
height: 150px;
margin: 5px;
border: 1px solid #ccc;
font-size: 1em;
line-height: 148px;
}
div img {
margin-top: expression(( 150 - this.height ) / 2);
}
html>body div img { /*hidden from IE 5-6 */
margin-top: 0; /* to clean up, just in case IE later supports valign! */
vertical-align: middle;
}
Note: some <script> tag, either inline or external (can be a dummy one), is needed to get IE 5.0 on track.
* Extended from Steve Clay's http://mrclay.org/web_design/centered_image/
* Note: CSS expression should be hidden in IE contidional comments to get clean valid css file.
* Note 2: is requiered before and after the image for proper display in IE Mac and Opera.