Background image doesn't repeat when browser window is smaller than content?

后端 未结 6 1532
小鲜肉
小鲜肉 2020-12-20 15:37

I have a header-container with a background image, like so:

#header-container
{
background:url(../img/bg.jpg) repeat-x 0 0px;
margin:0px auto;
width:100%;
te         


        
6条回答
  •  不知归路
    2020-12-20 16:20

    Try using an :after pseudo element with your image in it.

    #header-container:after {
        content: "";
        background:url(../img/bg.jpg) repeat-x 0 0px;
        width: 9999px;
        position: absolute;
    }
    

    Or something like that.

提交回复
热议问题