Any bug with hsla(0, 0%, 0%, 0), becoming hsla(0,

2019-04-13 04:21发布

I set up a text color as hsla(0, 0%, 0%, 0) to hide it. But sometimes it became hsla(0, 0, 0, 0), which can't be executed by browser.

I can fix this if I go the site with incognito mode. I have no idea if it's a bug in Chrome, from the server or just cache problem. If so, why it happens so often and how to fix it?

hsla(0, 0%, 0%, 0) become hsla(0, 0, 0, 0) in browser

1条回答
神经病院院长
2楼-- · 2019-04-13 05:16

Zero's should be unitless in css.

Lengths refer to distance measurements.The format of a length value (denoted by in this specification) is a (with or without a decimal point) immediately followed by a unit identifier (e.g., px, em, etc.). After a zero length, the unit identifier is optional.

See http://www.w3.org/TR/CSS2/syndata.html#length-units for more information.

Here is another Stackoverflow answer supporting this reason.

查看更多
登录 后发表回答