
在css文件中,字体加粗属性为“font-weight”,该属性可设置字体文本的粗细程度,当属性值设置为“bold”时可定义粗体字符,设置为“bolder”时可定义更粗的字符。
本教程 *** 作环境:windows7系统、CSS3&&HTML5版、Dell G3电脑。
在css文件中,字体加粗属性为“font-weight”。
font-weight 属性可设置文本的粗细,支持多种属性值:
- 100
- 200
- 300
- 400
- 500
- 600
- 700
- 800
- 900
示例:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>css 文字加粗</title>
<style>
p.normal {
font-weight: normal;
}
p.bold {
font-weight: bold;
}
p.bolder {
font-weight: bolder;
}
p.thicker {
font-weight: 900;
}
</style>
</head>
<body>
<p class="normal">测试文本!</p>
<p class="bold">测试文本!</p>
<p class="bolder">测试文本!</p>
<p class="thicker">测试文本!</p>
</body>
</html>(学习视频分享:css视频教程)
以上就是在css文件中字体加粗属性为什么的详细内容,
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)