It is recommendable to type the color's name instead of its hex value in CSS?

I always forget what colors I'm dealing with in CSS when I see it hex value. I would like to use the name instead (eg color: lightgreen). Is it supported by all browsers? (or only the basic 16 colors)?


我更喜欢十六进制值,因为它受所有浏览器支持,我可以指定比指定颜色更广泛的颜色。


CSS uses 17 standard colors. These are all safe to use. There are also system colors whose values is system and browser dependent but might be useful for integrating into system defaults but this is deprecated by CSS3 Color (for whatever that is worth).


Now every popular browsers support the 17 base colors plus 130 more color name http://www.w3.org/TR/2003/CR-css3-color-20030514/#svg-color and http://www.w3schools.com/css/css_colornames.asp

So not only you can safely use those 17 base colors name but you can also use the 130 SVG 1.0 color keyword names

链接地址: http://www.djcxy.com/p/87556.html

上一篇: 多级垂直排序列表菜单

下一篇: 建议在CSS中输入颜色的名称而不是十六进制值?