I was searching for solution for hours but can't find it.
I have div with fixed height and 50% width. And I want to display a picture inside it with 100% width and default aspect ratio but vertically centered

Thanks ;)
<div class="wrap"> <img class="img"> </div>
Add overflow:hidden to your div and then adjust the margin of the image into the negative. How much depends on the div's fixed height and the image height.
http://jsfiddle.net/willthemoor/Cu3G5/ should get you started.
No comments:
Post a Comment