是否可以使用纯CSS像缩放img
一样按比例缩放div
? 这是我的第一次尝试:http://dabblet.com/gist/1783363
示例
div {
max-width:100px;
max-height:50px;
}
img {
max-width:100px;
max-height:50px;
}
实际结果
Container: 200 x 100
Div: 100 x 50
Image: 100 x 50
Container: 50 x 100
Div: 50 x 50 // I want this to be 50x25, like the image
Image: 50 x 25