0

I'm using Visual Studio Code. When I typed { background: url("big.jpeg"); in CSS style sheet my image is not shown in the live server or the browser, when typed { background: url("/big.jpeg"); } image is shown in the live server but not when it is opened in the browser. when I type{ background: url("./big.jpeg");} image is not shown in both live server and browser.

(image is not in a folder)

Dior
  • 69
  • 8
  • Make sure your image is in the correct location. As per [this SO answer](https://stackoverflow.com/a/940475/2181514) the `url(path)` is relative to the .css file. So if you have `url("big.jpg")` then it should be in the same folder/path as the css file. If you're not using a css file and instead have this in each page then it will need to be relative to that page (so may need multiple copies - use a single .css file). – freedomn-m Oct 13 '22 at 06:01
  • Can you provide some code example, please? And then I think this could be pretty solvable :) Even screenshot would be good enough with code and image location. – ApnikaPanika Oct 13 '22 at 08:57
  • Thank you very much. it worked when I put the image in the same folder as the CSS file. – Venuja Laksika Wickramarachchi Oct 14 '22 at 06:50

0 Answers0