HTML Colors


HTML Colors


In HTML, colors can be specified using various methods, including color names, hexadecimal values, RGB values, and HSL values. Here are some common ways to specify colors in HTML:


1. Color Names:


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

You can use predefined color names, such as "red," "blue," or "green." Here are a few examples:


Input :-



Output :-



2. Hexadecimal Values:


Colors can be specified using hexadecimal values. Hex values represent the intensity of red, green, and blue in the format #RRGGBB.


For example:


Input :-



Output :-


3. RGB Values:



Colors can also be specified using RGB values, which represent the intensity of red, green, and blue. The format is rgb(red, green, blue). Each value can range from 0 to 255.


For example:


Input :-



Output :-


4. HSL Values:


HSL stands for Hue, Saturation, and Lightness. Colors can be specified using HSL values in the format "hsl(hue, saturation%, lightness%)" .


For example:


Input :- 



Output :-

These are some of the basic ways to specify colors in HTML. Choose the method that best suits your needs and design preferences.

Comments

Archive

Followers