How to add an background to your website?

I pretty much just want to add an background, to my hello-webpage app. How am I supposed to do that?

Would you like the background to be a color, or image?

If it is color, then in the body tag in your css configuration file have the following

background-color : (color name or hex);

If it is an image:

background-image: (image link);

What about for HTML?

Hi Cryx,

Even though the page is HTML, we still use CSS to set the background image. They’re made to work together! :blush:

Here’s roughly what I’d do:

		body { 
			background : url(img/flower.png) #b7e500;
	<h1>My Cool Page</h1>

That’s how the page would be stuctured. The background all-in-one rule uses img/flower.png if it can find it (replace that with your background image path) and it uses the green colour before the image loads or if the image can’t be found.

Hope that helps :art:



Oooh! Thanks for your help, SteGriff!

1 Like

oooh! it works tysm guys!