Skip to main content

CSS-Color

Predefined colour names or RGB, HEX, HSL, RGBA, HSLA values are used to specify colours.

CSS Background Color

In CSS, the background-color property is used to specify the colour of an element's background. The background encompasses the entire size of the element, including padding and border but excluding margin. It makes the text much easier for the user to read.

<h1 style="background-color:DodgerBlue;">Hii all</h1>
<p style="background-color:Tomato;">css basics</p>

CSS Text Color

Headline 1

Headline 2

Headline 3

CSS Border Color

You can change the colour of the borders:

<h1 style="border:2px solid Tomato;">Hello World</h1>
<h1 style="border:2px solid DodgerBlue;">Hello World</h1>
<h1 style="border:2px solid Violet;">Hello World</h1>