Backgrounds, whether it be an image, a solid color, or even a gradient, are controlled via CSS in HTML5.It is the size of the element, plus the padding, and border.
Typically, you will expect to see a background image on a body tag, or other similar large tag. However, you can place them on any tag, and may find it useful to do so.
You need to determine which element you want to have a background, and apply it. It could be as simple as a background color, or a series of background properties used to generate the effect you want.
Background Color
A common example is to apply a background for a navigation link as you see below. This makes the link standout and be more noticeable to the end user.
Notice how the foreground color is also specified, and we made sure that it had a high contrast so that the end user can easily see it.
background-color
is a specific type of background setting in CSS. There are plenty of others.
nav a {
background-color: #333;
color: #fff
}
nav a:hover {
background-color: #fff;
color: #333;
}
Backgrounds in HTML was originally found on Access 2 Learn