Background Color
background-color
is a CSS property that allows you to change the background color of a webpage within your website. To change the colors, you can use the word i.e. ‘White’, the hex value, #ffffff
, or the rgb value: rgb(255,255,255)
.
Example
Say I wanted to change the background color of the header of my website, I can use the following piece of code:
h1 {
background-color: rgb(150, 0, 255);
}
This code tells my website that I am changing the background color of my header, h1
, to purple using rgb values!
If you want to know more about the background-color
property, you can go to the links at MDN Web Docs or w3schools. Both of these sites give excellent examples of the background-color CSS property that are interactive, and allow you to change and alter the values to see how the property works.