好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

css中怎么把文字加粗

css中把 文字加粗 的方法是,给文本设置 font-weight 属性,并且设置属性值为bolder,例如【p.thick {font-w ei ght:bolder;}】,bolder表示更粗的文本。

本文操作环境:windows10系统、css 3、 ThinkPad t480 电 脑。

如果我们要把文本给 加粗 ,可以使用css中的font-weigth属性来实现,下面让我们一起来 了解 下该属性。

font-weight 属性设置文本的粗细。

常用属性值:

normal 默认值。定义标准的字符。

bold 定义 粗体 字符。

bolder 定义更粗的字符。

lighter 定义更细的字符。

代码示例:

<!DOCTY PE  ht ML >
<html>
<head>
< ;m eta charset="utf-8"> 
<t IT le></title>
<style>
p.normal {font-weight:normal;}
p.light {font-weight:lighter;}
p.thick {font-weight:bold;}
p.thicker {font-weight:900;}
</style>
</head>

<body>
<p class="normal">This is a paragraph.</p>
<p class="light">This is a paragraph.</p>
<p class="thick">This is a paragraph.</p>
<p class="thicker">This is a paragraph.</p>
</body>

</html>

来看下运行效果:

学习视频分享:css视频教程

以上就是css中怎么把文字加粗的详细内容,更多请关注其它相关 文章 !

总结

以上是 为你收集整理的 css中怎么把文字加粗 全部内容,希望文章能够帮你解决 css中怎么把文字加粗 所遇到的问题。

如果觉得 网站内容还不错, 推荐好友。

查看更多关于css中怎么把文字加粗的详细内容...

  阅读:19次