css image center crop 图片适应父类div,图片等比拉伸适应父类div。

<div>
    <img src="http://www.haleywang.com/wp-content/uploads/2015/05/aa.jpeg" />
</div>
<div>
    <img src="http://www.haleywang.com/wp-content/uploads/2015/05/bb.jpeg" />
</div>
css
div
{
    width: 200px;
    height: 200px;
    overflow: hidden;
    margin: 10px;
    position: relative;
}
img {
    position:absolute;
    left: -100%;
    right: -100%;
    top: -100%;
    bottom: -100%;
    margin: auto;
    min-height: 100%;
    min-width: 100%;
}