Files
freeCodeCamp/mock-guide/english/html/attributes/body-background-attribute/index.md
Stuart Taylor 7da04a348b fix: Update packages and fix local dev (#26907)
<!-- Please follow this checklist and put an x in each of the boxes, like this: [x]. It will ensure that our team takes your pull request seriously. -->

- [x] I have read [freeCodeCamp's contribution guidelines](https://github.com/freeCodeCamp/freeCodeCamp/blob/master/CONTRIBUTING.md).
- [x] My pull request has a descriptive title (not a vague title like `Update index.md`)
- [x] My pull request targets the `master` branch of freeCodeCamp.
2018-10-23 18:48:46 +05:30

38 lines
919 B
Markdown

---
title: Body Background Attribute
---
## Body Background Attribute
If you want to add a background image instead of a color, one solution is the `<body background>` attribute. It specifies a background image for an HTML document.
Syntax:
`<body background="URL">`
Attribute:
`background - URL for background image`
Example:
```html
<html>
<body background="https://assets.digitalocean.com/blog/static/hacktoberfest-is-back/hero.png">
</body>
</html>
```
## body-background attribute is depreciated
the body-background attribute been deprecated in HTML5. The correct way to style the ```<body>``` tag is with CSS.
There are several CSS properties used for setting the background of an element. These can be used on <body> to set the background of an entire page.
## Check it Out:
* [CSS background proprety](https://github.com/freeCodeCamp/guides/blob/master/src/pages/css/background/index.md)