Main content
Unlisted resources area
Course: Unlisted resources area > Unit 2
Lesson 2: Webpage documentation- HTML: The h1 to h6 tags
- HTML: The p tag
- HTML: The br tag
- HTML: The ul, ol, and li tags
- HTML: The strong and em tags
- HTML: The a tag
- HTML: The image tag
- HTML: The table tags
- CSS: The element selector
- CSS: The descendant selector
- CSS: The class selector
- CSS: The id selector
- CSS: The color property
- CSS: The background-color property
- CSS: The font-family property
- CSS: The font-size property
© 2023 Khan AcademyTerms of usePrivacy PolicyCookie Notice
CSS: The background-color property
The
background-color
property changes the background color of the element. All elements default to a transparent background. Colors can be specified in several ways:Value | Description | Example |
---|---|---|
name | Every browser knows 16 common color names. | red |
rgb() | A triplet of values from 0 to 255, representing the Red-Green-Blue color spectrum. | rgb(255, 0, 0) |
rgba() | Like rgb() , but with a fourth value representing the opacity, ranging from 0 to 1. | rgba(255, 0, 0, 0) |
hex | A hexadecimal number representing the R-G-B triplet. | #FF0000 |