CSS: Setting background-image in CSS

后端 未结 8 1841
一整个雨季
一整个雨季 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:49

    If it is a relative path, remove the heading "/" in the url path?

    0 讨论(0)
  • 2021-01-05 04:51

    Depending on your folder structure and where the CSS is located relative to the images it is using you will have to go up to the root level of the image directory and access it from there so you could maybe try something like

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

    0 讨论(0)
提交回复
热议问题