...

View Full Version : valign middle for image in div



esthera
08-06-2007, 08:15 PM
.thumbimage{
width:125px;
height:180px;
border: thin solid #999999;


}

above is my css

this is a div around an image

how can I make it that any image in this div should be vertical aligned centered?

Arbitrator
08-07-2007, 07:21 AM
how can I make it that any image in this div should be vertical aligned centered?
.thumbnail { display: table-cell; vertical-align: middle; } /* CSS2+ */
.thumbnail img { margin-top: expression((this.parentNode.clientHeight - this.clientHeight) / 2 + "px"); } /* IE */Note that the Internet Explorer method will fail when JScript is disabled.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum