任何与hsla(0,0%,0%,0),成为hsla(0,0,0,0)的错误? (缺少百分号) [英] Any bug with hsla(0, 0%, 0%, 0), becoming hsla(0, 0, 0, 0)? (missing percent sign)

查看:177
本文介绍了任何与hsla(0,0%,0%,0),成为hsla(0,0,0,0)的错误? (缺少百分号)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了一个文本颜色 hsla(0,0%,0%,0)来隐藏它。但有时它变成 hsla(0,0,0,0),这不能由浏览器执行。

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.

如果我使用无痕模式进入网站,我可以解决这个问题。我不知道这是一个错误在Chrome,从服务器或只是缓存问题。如果是,为什么会发生这种情况,以及如何解决?

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?

推荐答案

零在css中应该是无单位的。
$ b

Zero's should be unitless in css.


长度是指距离测量。长度值的格式(在本规范中表示)是一个(有或没有小数点),紧接着是一个单位标识符(例如,px,em等)。在零长度之后,单元标识符是可选的。

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.

查看 http://www.w3.org/TR/CSS2/syndata.html#length-units 了解详情。

这里是另一个< a href =http://stackoverflow.com/a/7923077/2648679> Stackoverflow answer 支持此原因。

Here is another Stackoverflow answer supporting this reason.

这篇关于任何与hsla(0,0%,0%,0),成为hsla(0,0,0,0)的错误? (缺少百分号)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆