Are there any good reasons for using hex over decimal for RGB colour values in CSS?

前端 未结 12 2811
庸人自扰
庸人自扰 2020-12-01 07:17

rgb(255,255,255) notation has been available since CSS1. But #ffffff seems to be vastly more popular.

Obviously it\'s slightly more compact

12条回答
  •  独厮守ぢ
    2020-12-01 07:48

    Hex values are easier to copy and paste from your favourite image editor.

    RGB values are easier to manipulate with Javascript.

    (My favourite Hex colour value is #EDEDED and a site we made for a client involved in motorsport had a background colour of #F1F1F1 :-)

    Ed.

提交回复
热议问题