Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将裁剪后的图像(如 150 宽 170 高)放到 200 宽 px 170 高 px 的框架/画布上,请在 html 中告诉我。因此,每次上传图像时,它都会自行裁剪,如果它不是 200px 170px 尺寸,那么它的画布会自动从两侧变为黑色,其余部分
试试这个
.frame {width:200px; height:170px; overflow:hidden;} .frame img {width:100%; height:auto;}
upd:但图像的底部将被隐藏