css设置字体粗细的属性是什么


本文摘自PHP中文网,作者青灯夜游,侵删。

css设置字体粗细的属性是font-weight属性,该属性的取值为“lighter”、“normal”、“bold”和“bolder”;“lighter”为细体,“normal”为正常粗细,“bold”为粗体,“bolder”为特粗体。

本教程操作环境:windows7系统、CSS3&&HTML5版、Dell G3电脑。

在CSS中,通过 font-weight属性 用来设置字体的粗细值,取值为 lighter | normal | bold | bolder,默认为 normal。lighter 为细体,normal 为正常粗细,bold 为粗体,bolder 为特粗体。如:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

.lighter {

 font-weight: lighter;

}

.normal {

 font-weight: normal;

}

.bold {

 font-weight: bold;

}

.bolder {

 font-weight: bolder;

}

 

<p class="lighter">字体粗细: lighter</p>

<p class="normal">字体粗细: normal</p>

<p class="bold">字体粗细: bold</p>

<p class="bolder">字体粗细: bolder</p>

上述代码定义了 4 种不同粗细的字体,按顺序依次变粗。运行结果如图所示:

阅读剩余部分

相关阅读 >>

css属性box-sizing详解

css如何设置所有标签

css如何实现圆角内凹效果

css中背景图片有哪些属性

css滚动条颜色怎么设置

css实现加号“+”效果(代码示例)

css text-outline属性怎么用

css写在html里面吗?

css实现箭头和带缺口提示框

常用的css背景属性介绍

更多相关阅读请进入《css》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...