Css颜色定义的方法汇总color属性设置方式

  • 颜色的定义方式用rgb()里面带上十进制的数字来定义。

color:rgb(211,123,135);

  • 用预定义的颜色名称。

color:red;

  • rgba()最后一个参数是不透明度。

color:rgba(1,23,45,0.5);

  • 用hsl()函数

color:hsl(78,70%,90%);

  • 用hsla()函数

color:hsla(234,100%,45%,0.9);

  • 用hex表示。

color:#02a2e2;

posted @ 2016-05-25 01:13  公子子玉  阅读(912)  评论(0编辑  收藏  举报