问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/31779146/any-bug-with-hsla0-0-0-0-becoming-hsla0-0-0-0-missing-percent-sig