No.15 CSS--字体属性

一、color

  • 四种方式:
            color: aquamarine;
            color: #ff0000;
            color: rgb(255, 0, 0);
            color: rgba(255, 0, 0, 0.5);   #最后一个代表透明度

二、font-size 

font-size: 45px;

  注:px可写可不写。

三、font-weight 字体粗细

  • 定义文字的粗细。
  •  

font-weight: bold;

  

四、font-style 字体样式

font-style: normal;  默认
  font-style: italic;  斜体

五、font-family字体

font-family: 'Times New Roman', Times, serif;
    font-family: '微软雅黑';   #也可直接用中文

  

 

posted @ 2025-02-26 16:37  百里屠苏top  阅读(10)  评论(0)    收藏  举报