我使用這個CSS:CSS:響應背景圖像高度
.wrap {
max-width:1400px;
min-width:768px;
width:100%;
background-repeat: no-repeat scroll;
background-position: center top;
position: relative;
margin-top: 0;
margin-right: auto;
margin-bottom: 0;
margin-left: auto;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.image {
width: 100%;
height: 600px;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
要居中的圖像和規模根據窗口大小,在768px停止縮放。當窗口尺寸較大時,我無法顯示圖像的底部(當窗口最小化時它可以正常工作)。當我改變.image
類的高度超過600px的,它打破了圖像縮放...
這裏的問題的演示: http://jrbaldwin.com/css_issue/
嘗試'背景位置:中心中心;背景重複:不重複; background-size:contains;'.image'類和'min-width:100%;''.wrap'類 - 在FF中查看我的權利。 –