How to Set CSS Colors ?

CSS color properties allows us to color the Background and Foreground Color on a Web Page. We can set CSS color on text, backgrounds, borders, and other parts of elements in a document.

CSS Background Color

How to set CSS body background color ?

You can define the background color of a webpage by specify its body background color property.

output

CSS background color

How to set CSS Paragraph background color ?

output

CSS paragraph color

How to set CSS div back color ?

output

CSS div background color

CSS Foreground Color

How to change CSS text color ?

When we want to change the color of a text (foreground color) in an HTML document the term color is used to specify the CSS property.

The above CSS code states that all the text elements under body shall be of Maroon color

CSS foreground color

How to Change the Font Color with CSS ?

When you set foreground color , actually the font color will change.

The above code change the font color inside the H1 tag.

Border Color

how to set CSS border-color

The border-color property specifies the border color for each side of the box.

output

CSS border color

You can specify border color to each side specifically.

output

CSS border color each side