Background image doesn't show when defined in stylesheet

后端 未结 2 1851
情话喂你
情话喂你 2021-02-20 10:36

I am very new to css so this maybe a simple answer. I have 2 scenarios and 1 works the other doesn\'t. I hope someone can help me out.

WORKS:



        
2条回答
  •  故里飘歌
    2021-02-20 11:16

    It looks like your CSS file is in the views/default/ folder, while the image is in the views/default/images/ folder.

    Define image paths in your CSS relative to the CSS file, not the HTML file that displays everything:

    background-image:url('images/home.jpg');
    

提交回复
热议问题