css入门4 字体属性

字体属性

/*设置字体*/
body {
font-family: "Microsoft YaHei UI","微软雅黑","Arial",sans-serif;
}
body {
    font-family: "Microsoft YaHei UI","微软雅黑","Arial",sans-serif;
}
p {
            font-size: 32px;
        }

 字体粗细

  font-weight:

     normal   默认

     bord    粗体

     border  更粗

      100-900

      inherit   继承父元素字体的粗细值

字体颜色:

  color:red;

  color:rgb(255,255,255)

  color:#ff0000

文字对齐:

1 text-align:center;
文字居中
text-align: right;
text-align: justify; 两端对齐

/*----下划线*/
text-decoration: underline;
/*文本上的一条线*/
text-decoration: overline;
/*穿过文本的一条线*/
text-decoration: line-through;

去掉a标签的下划线:
a {
text-decoration: none;
}
首行缩进:
text-indent: 28px;


猜你喜欢

转载自www.cnblogs.com/WorkWonders/p/11254673.html
今日推荐