【发布时间】:2011-10-05 15:46:39
【问题描述】:
我想将图像放入比图像小得多的 div 元素中,并在 div 元素之外隐藏或裁剪图像。我已经这样做了:
.slideshow img {
width: 250px;
}
.slideshow {
overflow: hidden;
height: 170px;
width: 250px;
position:relative;
}
它工作正常,但我从顶部裁剪图像,但我想居中图像,然后从顶部和底部裁剪它。我该怎么做?
【问题讨论】:
标签: image html center hidden crop