Home > Back-end >  Need help putting a background image in html and css
Need help putting a background image in html and css

Time:01-13

I've been trying to put a background image on a website using html and css, I've watched youtube videos but it never works for me. I was wondering if anyone could help point out what I've been doing wrong. Thank you!

Tried putting an image as a background for a website but whenever I save and reload the website it never appears and is just blank.

I forgot to add the speech marks thing here, but even when I added it, it still never worked

CodePudding user response:

You can try this code

With proper path.

CodePudding user response:

update the path to

background-image: url(../ronaldo.jpg);

go through this article for a better understanding of using path absolute-vs-relative-paths

CodePudding user response:

You have the wrong path. Your image is not in the same folder as your css file. Put a correct path, try this: background-image: url(../ronaldo.jpg);. If it still doesn't work, tru putting the path in between of " " like this: background-image: url("../ronaldo.jpg");

CodePudding user response:

Try typing in "/" in the url brackets and the intelisense should appear. It should give you all possible images in your folder.

  • Related