为什么我第一张背景和第二张背景显示了,第三张没有显示

对照了老师代码,都一样

.page{

height: 100%;

}

/*分页背景*/

.page > .bg{

z-index: -1;

position: absolute;

width: 100%;

height: 100%;

}

/*第一页*/

#page1 > .bg{

background: url(../img/p1_bg.jpg) no-repeat center center;

background-size: 100%;

}

/*第二页*/

#page2 > .bg{

background: url(../img/p2_bg.jpg) no-repeat center center;

background-size: 100%;

/*第三页*/

#page3 > .bg{

background: url(../img/p3_bg.jpg) no-repeat center center;

background-size: 100%;


神一樣的男人3392911
浏览 1355回答 2
2回答

Gir非碼農

第三页上面少了个花括号?

永夜君主

楼上正解,第二页background-size: 100%;后面没花括号,导致第三页的样式无效;
打开App,查看更多内容
随时随地看视频慕课网APP