CSS: Setting background-image in CSS

后端 未结 8 1902
一整个雨季
一整个雨季 2021-01-05 03:46

What is the correct syntax when setting the background-image in CSS? In visual studio, there seems to be no problem in the background since it appears. But in the browser li

8条回答
  •  自闭症患者
    2021-01-05 04:36

    My CSS file is in "Themes" folder. The images are saved in "Images" folder. Both "Themes" and "Images" are sub-folders under the root directory of my project.

    In this case you should use

    background-image: url(../Images/imageName.jpg);
    

提交回复
热议问题