Define colors using the Hue-Saturation-Lightness model (HSL) with CSS

CSSWeb DevelopmentFront End Technology

To define colors using the Hue-Saturation-Lightness model (HSL), use the hsl() CSS method.

You can try to run the following code to implement the hsl() function in CSS

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         h1 {
            background-color:hsl(0,100%,50%);
         }
         h2 {
            background-color:hsl(192,89%,48%);
         }
      </style>
   </head>
   <body>
      <h1>Red Background</h1>
      <h2>Blue Background</h2>
   </body>
</html>
raja
Published on 01-Jun-2018 11:12:42
Advertisements