4

I am trying to declare the border of a div using hsl() like this:

border: 2px solid hsl(0,200,105);

I am using Firefox 3.5 and there is no border being rendered at all. The same code works perfectly if hsl() is replaced with rgb()

I read somewhere that Firefox supports hsl() and hsla()

Am I doing something wrong?

and if hsl() is not supported, does anybody have any code to convert hsl to rgb?

KJ Saxena
  • 21,452
  • 24
  • 81
  • 109

1 Answers1

4

According to the CSS specs, the syntax should be:

hsl(240, 100%, 50%);

Here's a nice tutorial on Working with HSL in CSS, and a useful converter.

Kobi
  • 135,331
  • 41
  • 252
  • 292
  • I think the passive aggressive 'first google result' comment is unnecessary! – ljs Dec 09 '12 at 14:11
  • the year is 2022, and now this page IS the first google result for "border color hsl not working" – andy Sep 02 '22 at 21:06
  • @andy - good point, thanks! Also a good opportunity to rephrase that and make the answer nicer. – Kobi Sep 02 '22 at 23:12