3 ms·
This doesn't work with CSS, right? Only the color attribute of HTML.
by ilaksh 2y ago
This doesn't work with CSS, right? Only the color attribute of HTML.
- esperent 2y agoYeah it addresses that towards the end of the article. CSS has different rules for parsing badly formatted colors. Unsurprising given that CSS colors can be in several different formats (hex, RGB, RGBA, HCL etc.).
- debo_ 2y agoFrom the article: > CSS has its own set of fascinating peculiarities when it comes to handling invalid colour values. Most modern browsers will clamp values rather than reject them outright -– throw rgb(300, -50, 1000) at a browser and it won't fail; it'll helpfully transform it into rgb(255, 0, 255).