본문 바로가기

hybrid app/css3

[css3] image crop center

div
{
    width: 200px;
    height: 200px;
    overflow: hidden;
    position: relative;
}
img {
    position:absolute;
    left: -100%;
    right: -100%;
    top: -100%;
    bottom: -100%;
    margin: auto; 
    min-height: 100%;
    min-width: 100%;
}

http://stackoverflow.com/questions/18673900/how-to-center-and-crop-an-image-to-square-with-css

http://stackoverflow.com/questions/11552380/how-to-automatically-crop-and-center-an-image