FANDOM


The background-color property is used in CSS and some special HTML tags to create a background color of a particular object. The overall effect without any borders or curved edges will be like highlighted text. You can customize the background-color property with the border-radius and -moz-border-radius properties.

To apply this in the HTML document, use:

<span style="background-color:white; color:black;">See the bg</span>

That will make this: See the bg. The color property is used to specify the color of the text. Notice how the background color only wraps around the text, leaving no extra padding.

To apply this in a CSS document, use this on any particular element you want, like the h1 element:

h1 {
     background-color:white;
     color:black;
}

Any color will work, as well as HTML color codes (#000000, #666666, #999999, #CCCCCC, etc).

See Also

background-image

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.