Horje
How to create HTML Shades of Gray

Shades of gray are often defined by setting the hue and saturation to 0, and adjusting the lightness from 0% to 100% to get darker/lighter shades:


Full Example of HTML Shades of Gray

Try following
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1 style="background-color:hsl(0, 0%, 20%);">hsl(0, 0%, 20%)</h1>
<h1 style="background-color:hsl(0, 0%, 30%);">hsl(0, 0%, 30%)</h1>
<h1 style="background-color:hsl(0, 0%, 40%);">hsl(0, 0%, 40%)</h1>
<h1 style="background-color:hsl(0, 0%, 60%);">hsl(0, 0%, 60%)</h1>
<h1 style="background-color:hsl(0, 0%, 70%);">hsl(0, 0%, 70%)</h1>
<h1 style="background-color:hsl(0, 0%, 90%);">hsl(0, 0%, 90%)</h1>

</body>
</html>

Output should be:

Full Example of HTML Shades of Gray





Related Articles
What is HTML HSL and HSLA Colors HTML HSL Colors
How to create HTML HSL Color Values HTML HSL Colors
How to create HTML Saturation Color HTML HSL Colors
How to create HTML Lightness Color HTML HSL Colors
How to create HTML Shades of Gray HTML HSL Colors
How to create HTML HSLA Color Values HTML HSL Colors

Single Articles
Full Example of HTML Shades of GrayHTML HSL Colors

Read Full:
HTML HSL Colors
Category:
Web Tutorial
Sub Category:
HTML HSL Colors
Uploaded by:
Admin
Views:
79


Reffered: https://www.w3schools.com/html/tryit.asp?filename=tryhtml_color_hsl_gray