Css颜色,文本字体

css颜色表示法

  1. 颜色名表示,比如:red 红色,gold 金色
  2. 16进制数值表示,比如:#ff0000 表示红色,这种可以简写成 #f00
  3. RGB颜色: 红(R)、绿(G)、蓝(B)三个颜色通道的变化 background-color: rgb(200,100,0);
  4. RGBA颜色: 红(R)、绿(G)、蓝(B)、透明度(A) background-color: rgba(0,0,0,0.5);

     16进制  0-9 a-f
    
     rgb的值 0-255
    

css文本设置

常用的应用文本的css样式:

color 设置字体透明度 transparent 

color 设置文字的颜色,如: color:red;

font-size 设置文字的大小,如:font-size:12px;

font-family 设置文字的字体,如:font-family:'微软雅黑';

font-style 设置字体是否倾斜,如:font-style:normal; 设置不倾斜,font-style:italic;设置文字
倾斜

font-weight 设置文字是否加粗,如:font-weight:bold; 设置加粗 font-weight:normal 设置不加粗


line-height 设置文字的行高,如:line-height:24px;

text-decoration 设置文字的下划线,如:text-decoration:none; 将文字下划线去掉

text-indent 设置文字首行缩进,如:text-indent:24px; 设置文字首行缩进24px

text-align 设置文字水平对齐方式,如text-align:center 设置文字水平居中

猜你喜欢

转载自blog.csdn.net/weixin_43682329/article/details/84592289