Nikita Manahov Nikita Manahov - 9 months ago 12
HTML Question

How do I add a background to my html document?

I have attempted adding a sky background to my website's stylesheet, but nothing really happened.

body {
background: "sky-08.jpg";

When I previewed the page, the background was white, like when I just started making my page.


It should be: background-image: url("sky-08.jpg");

This also assumes that the image file is in the same location as the CSS file (Or HTML file if it is inline)

If the image is located under an images folder in the root directory: background-image: url("/images/sky-08.jpg");