I have a div which contain 2 images inside it.
First image’s height is just as per div height but second image height is less then div height. I want to vertically central align this image which I have failed to do. Here is my markup, please advise me how to do this so that it will work in all current browsers.
Thanks
<div class="left">
<img alt="" src="Images/Logo.png" style=" border:2px dashed red;" />
<img class=TI alt="Tayyiba Institute" src="Images/TayyibaInstitute.png" style=" border:2px dashed orange;" />
</div>
div.Container div.Left
{
width:50%;
float:left ;
display:inline;
}
div.Container div.Left img.TI
{
width:92px;
height:95px;
float:left;
line-height:200px;
vertical-align:middle;
margin:auto 0 auto 0;
display:block ;
}
Well here’s a lot of mistakes…let me go through 1 by 1…
1) No quotes here
class=TI2) Where’s the container div over here?
div.Container div.Left img.TIYou need to float your first image to the left and give
position: relative;to the second image like this :My fiddle
HTML
CSS
SUGGESTION: Clean up the CSS And learn more