[Solved] Background not showing

[Solved] Background not showing
0.0 0

#1

Hello all. I’m new to the site and I find it to be very informative. I’m on my tribute project now. I have been reviewing other tribute pages and I came across this one. Aaron Swartz I like how the top image moves when scrolling up. I’m on the first step of building my tribute page and can’t get the background to show up. Can someone assist me with this?

My CodePen page.


#2

Hi, Cori
Try this code:
body {
background-image: url(‘https://creatingtruehappiness.com/wp-content/uploads/2018/01/will-smith-quotes-1024x576.jpg’);

}


#3

You need a quotation mark to wrap you url. like:
.banner-background {
background-image: url(‘https://creatingtruehappiness.com/wp-content/uploads/2018/01/will-smith-quotes-1024x576.jpg’);

}
and you banner div is empty, therefore you may not be able to see the background image.


#4

You can set the height of the div if you want the image contained within the div:

.banner-background {
background-image: url(https://creatingtruehappiness.com/wp-
content/uploads/2018/01/will-smith-quotes-1024x576.jpg);
height: 500px;
background-repeat: no-repeat;
}

Or if you want it to cover the whole page, put it in the body like Alimama says:

body {
background-image: url(https://creatingtruehappiness.com/wp-
content/uploads/2018/01/will-smith-quotes-1024x576.jpg);
}

Also set the other properties:

background-position: center;
background-repeat: no-repeat;
background-size: cover;
https://www.w3schools.com/howto/howto_css_full_page.asp


#5

Thanks all. That helped.