我已經閱讀了很多關於響應CSS背景圖像的文章,但我無法讓我的工作。與響應背景圖像奮鬥
我的網站是http://www.conn3cted.uk.tn/intManagement.html,我正在嘗試將圖片用作「橫幅」,因此不能將高度設置得太大。
我似乎可以在桌面或移動設備上解決問題,但他們不想一起工作。我已經使用了建議的解決方案(下面),但是我沒有把整個圖片放大/縮小,它只顯示了一部分或大量的空白區域。我究竟做錯了什麼!?
.whatWeDo {
padding-top: 100px;
background-image: url("/images/intManagement/homePage/whatwedo.jpg");
background-repeat: no-repeat;
background-size: cover;
background-position: center;
height: 120px;
}
嘗試使用'margin-top'而不是'padding-top' –
查看此li nk for responsive圖片https://responsivedesign.is/resources/images/picture-fill –