0

如何将裁剪后的图像(如 150 宽 170 高)放到 200 宽 px 170 高 px 的框架/画布上,请在 html 中告诉我。因此,每次上传图像时,它都会自行裁剪,如果它不是 200px 170px 尺寸,那么它的画布会自动从两侧变为黑色,其余部分

4

1 回答 1

1

试试这个

.frame {width:200px; height:170px; overflow:hidden;}

.frame img {width:100%; height:auto;}

upd:但图像的底部将被隐藏

于 2013-08-30T20:08:31.390 回答