I have the this piece of code here…
<div class="pics2">
<div style="position: absolute; top: 0px; left: 0px; display: block; z-index: 4; opacity: 1; width: 225px; height: 200px;"> // this div is generated via jQuery Plugin
<div style="display:table-cell; vertical-align:middle; height:200px;">
<img src="upload/<?php echo $array['image5'] ?>" width="225" />
</div>
</div>
</div>
and here is the CSS
.pics2 {
padding: 0;
margin-left:20px auto;
margin-right:20px auto;
width:225px;
height:200px;
overflow:hidden;
float:left;
}
.pics2 div{
width:225px;
height:200px;
}
.pics2 img {
background-color: #eee;
margin: auto;
display:block;
vertical-align:middle;
}
What I am trying to do is vertically align the image inside three divs, the code above works in every single browser except IE7…any one got any ideas how to fix it?
I hope it will help to resolve your issue(Some cheats for IE 7 in the bottom of the article)
Vertically Center Multi-Lined Text
For Example code like this
instead of
parentNode.offsetHeight/2– determines the container’s height and divide it by 2. This gives us a margin exactly half the height of the screen-(parseInt(offsetHeight)/2))– determines the height of the centering block.