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

后端 未结 6 1530
小鲜肉
小鲜肉 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条回答
  •  猫巷女王i
    2020-12-20 16:10

    I am not allowed to comment, so I will add another answer here, maybe it helps someone.

    Kevin Reid's solution worked for me, but only in conjuction with setting the width to 100%, so this is what I ended up with:

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

提交回复
热议问题