我試圖將div中的圖像位置放在圖庫中。 看看下面的鏈接http://geeksdoor.in/ghouri/portfolio.php居中圖像沒有拉伸和使用css調整大小
.gallery-item, .grid-sizer {
width:25%;
height:200px;
display:block;
position:relative;
overflow:hidden;
}
.gallery-item img, .grid-sizer img {
position:relative;
top:0;
left:0;
width:100%;
max-height:100%;
display: block;
overflow:hidden;
z-index:1;
}
,該頁面 http://geeksdoor.in/ghouri/portfolio-single.php?type=int&imgnumb=0
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
/* background-size: cover; */
background-attachment: scroll;
background-position: center;
background-repeat: no-repeat;
background-origin: content-box;
第一形象是好的,在滑蓋其他圖像越來越捉襟見肘。
請幫忙,如果在CSS中有任何錯誤!並提前感謝球員。
歡迎的StackOverflow! 鏈接無法從我的位置打開(由於DNS),更好的方法是提供標記摘錄 – Vasfed