0

当我执行以下代码时,它会一直工作到我调整页面大小时,背景图像会重复,即使背景重复设置为无。任何原因,您都可以在此处查看该页面

#mainPage{
    background-image: url(../images/home.JPG);
    width: 100%;
    height: 500px;
    background-size: 100%;
    background-repeat: none;
}
4

1 回答 1

5

它是no-repeat,不是none

#mainPage{
    background-image: url(../images/home.JPG);
    width: 100%;
    height: 500px;
    background-size: 100%;
    background-repeat: no-repeat;
}

无论你设置background-size不应该有所作为。

于 2013-01-18T05:45:13.483 回答