Computer >> คอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

กำหนดสีโดยใช้โมเดล Hue-Saturation-Lightness (HSL) ด้วย CSS


ในการกำหนดสีโดยใช้โมเดล Hue-Saturation-Lightness (HSL) ให้ใช้วิธี hsl() CSS

คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อใช้ฟังก์ชัน hsl() ใน CSS

ตัวอย่าง

<!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>