我是网页设计的新手,在包装器中设置背景图片时遇到了一个小问题。请善意地浏览以下源代码和css文件。您的同意将受到高度赞赏。
#wrapper {
width: 100%;
top: 0;
left: 0;
position: absolute;
background-image: url(http://lorempixel.com/300/300);
}

<div id="wrapper"></div>
&#13;
答案 0 :(得分:1)
您还必须指定height
。
#wrapper {
width: 100%;
height: 100%;
top: 0;
left: 0;
position: absolute;
background-image: url(http://www.lorempixel.com/300/300);
}
<div id="wrapper"></div>
答案 1 :(得分:0)
#wrapper {
width: 100%;
height:100%;
top: 0;
left: 0;
position: absolute;
background-image: url(http://lorempixel.com/300/300);
/*background-repeat: no-repeat;*/
}
<div id="wrapper"></div>