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

后端 未结 7 1336
南笙
南笙 2020-12-11 02:38

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 (e.g color: lightgreen). Is it supported by all browsers?

7条回答
  •  有刺的猬
    2020-12-11 02:52

    Use classes then

    
    
    

    This has the benefit you can refine your colors just by updating your CSS. Be aware though it isn't a great idea to name a class after how it appears, since you may want to change all your orange text to red and you'll end up with the class .lightorange {color:red} which is just odd.

提交回复
热议问题