HTML and CSS Background-image is not showing up

后端 未结 5 1943
太阳男子
太阳男子 2021-02-20 12:55

I already double checked my URL, and the name of the files, but I can\'t seem to get the image to show up. Why is it like that? Here\'s my code (take note the

5条回答
  •  忘了有多久
    2021-02-20 13:20

    Try this:

    background-image: url(../images/background.gif);
    

    Without the ../ it is looking for an images folder inside your stylesheet folder which does not exist. So you have to go back a directory where the images folder is located.

    Edit: You can also shorten up your CSS styles like so:

    .guarantee{
        background: #a7cece url(../images/background.gif);
        border: 1px solid black;
    }
    

提交回复
热议问题