Coding Asiruddin
HTML JAVASCRIPT

How to add HTML Color

HTML colors are specified with predefined color names, or with RGB, HEX, HSL, RGBA, or HSLA values.

Example





Colors Name

In HTML, a color can be specified by using a color name:

Red
Green
Blue
Orange
Dodgerblue
pink
Black
Gray
Violet


Background Color

You can set the background color for HTML elements:

Hello World

Lorem ipsum dolor sit, amet consectetur adipisicing elit. A, nostrum distinctio eveniet ullam modi rerum dicta aperiam suscipit dolorum. Fuga modi quo eos maiores? Distinctio cum asperiores obcaecati delectus iste?

Border Color

You can set the color border

Hello world

Hello world

Hello world



Color Value

In HTML, colors can also be specified using RGB values, HEX values, HSL values, RGBA values, and HSLA values.

The following three < div > elements have their background color set with RGB, HEX, and HSL values:

rgb(29,00,300)
#220055
hsl(100,50%,50%)