How do I load a back ground image?

I am trying to load a background image, when I use url("") nothing comes up. background-image: url("") however if I use the <img src="https..."> my image appears on the screen. I don’t know how to post the link to my pen.

Thanks,

You post the link by copying the address in the browser bar when you’re on codepen and pasting it into a reply here

1 Like

in css : body { background: url(‘pathtoimagewithextension’)
}

1 Like

Thank you so much.

I have it working in the body, but I wanted it in a div. I found that that does not work.

This might be a stupid question, but have you set the width and height properties to the div container?

1 Like

Yes it works.

div {
background:url(‘url’)

}

if that doesnt work you can add an img tag and set the dimensions in CSS.

Bootstaps alot better for this tho

Can you please post your code. Although people are trying to help, they cannot see what is in front of you, so the answers are guesses.

You post your code by typing

CODE HERE
1 Like