此圖片是太大了,我希望它適合窗口的大小:http://zgaming.comxa.com圖片/ DIV太大
,但我不明白怎麼回事,我也嘗試過的高度和寬度100%
HTML
<div class="bgimg"><img src="http://zgaming.comxa.com/dist/img/bg.jpg"></img></div>
CSS
.bgimg {
position: absolute;
top: 0;
left: 0;
z-index:-99;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
我也試過這個
.bgimg {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index:-99;
}
.imgbg {
position: absolute;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
這個答案 https://stackoverflow.com/a/43612299/7874902
的作品,但在移動設備上有在底部一些空白..
圖像並沒有顯示任何與此代碼:? – Andrei
什麼是「一個孩子的形象?」_你的措辭不清楚。 – hungerstar
兒童圖像是這樣的:div> img –