-1
我製作了我的完整寬度和響應的縮略圖圖像。因爲它們很高,所以我把它剪成600px。問題是,隨着屏幕變大,圖像會在頂部切割,而不是在我想要的圖像中心。有沒有辦法讓圖像在中心進行裁剪? 我不想在這裏使用background-image
。如何讓圖像在中心進行裁剪
這是fiddle。
.large-front-thumbnail {
position: relative;
max-width: 100%;
height: auto;
display: block;
margin: 0 auto;
}
.large-front-container {
max-height:600px;
overflow: hidden;
}
<div class="large-front-container">
<img src="https://static.pexels.com/photos/2855/landscape-mountains-nature-lake.jpg" class="large-front-thumbnail">
</div>