0

I tried to put an image named "books.jpg" on the background of my page but it says that it can't find it!However,I am sure that the link to the image is correct.

    background-image: url('/Users/abdulazizsuleymanov/Desktop/Python/Django/Review-book/books.jpg');
    /*background-color: #cccccc;*/
    width: 100px;
    height: 100px;```[css file][1]


  [1]: https://i.stack.imgur.com/0O1Ff.png
Abd-07
  • 1

2 Answers2

0

Why don't you put it directly in the same folder? That way you can just use url('./books.jpg')

Montin
  • 35
  • 4
0

Partial URLs are interpreted relative to the source of the style sheet, not relative to the document https://www.w3.org/TR/CSS1#url

It's easiest if you just put the image near the css file.

DvdRom
  • 738
  • 4
  • 13