CSS root directory

前端 未结 6 1490
小鲜肉
小鲜肉 2020-12-13 00:01

I have a style sheet where I include background images.

background: url(../Images/myImage.png);

problem is, pages from different directorie

6条回答
  •  渐次进展
    2020-12-13 00:44

    /Images/myImage.png
    

    this has to be in root of your domain/subdomain

    http://website.to/Images/myImage.png

    and it will work

    However, I think it would work like this, too

    • images
      • yourimage.png
    • styles
      • style.css

    style.css:

    body{
        background: url(../images/yourimage.png);
    }
    

提交回复
热议问题