css怎么设置字体加粗样式
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在前端页面的<span style="color: black;">研发</span>中,字体文字的效果是一个<span style="color: black;">要紧</span>的部分,有时为了<span style="color: black;">明显</span>一段文字,就<span style="color: black;">必须</span>给字体文字进行加粗<span style="color: black;">表示</span>;<span style="color: black;">那样</span><span style="color: black;">运用</span>css<span style="color: black;">怎样</span>给字体加粗?本篇<span style="color: black;">文案</span>就给<span style="color: black;">大众</span>介绍css设置字体加粗样式的<span style="color: black;">办法</span>。有<span style="color: black;">必定</span>的参考价值,有<span style="color: black;">必须</span>的<span style="color: black;">伴侣</span><span style="color: black;">能够</span>参考一下,<span style="color: black;">期盼</span>对你们有所<span style="color: black;">帮忙</span>。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><a style="color: black;"><span style="color: black;"><span style="color: black;">web前端学习:web前端<span style="color: black;">基本</span>资料免费领取(面试题、</span></span></a>视频、进阶路线)<span style="color: black;"><span style="color: black;"></span>zhuanlan.zhihu.com/p/136454207#comments</span></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">首要</span><span style="color: black;">咱们</span><span style="color: black;">经过</span>简单的代码示例,为<span style="color: black;">大众</span><span style="color: black;">仔细</span>解说关于css给字体加粗的实现<span style="color: black;">办法</span>!</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>css 字体加粗</title>
<style>
.a1{
font-weight:bold;
}
.a2{
font-weight:bolder;
}
</style>
</head>
<body>
<div>
<p>这是一段测试文字<br />
<span class="a1"><span style="color: black;">这儿</span><span style="color: black;">运用</span>bold属性值加粗字体</span><br />
<span class="a2"><span style="color: black;">这儿</span><span style="color: black;">运用</span>bolder属性值加粗字体</span>
</p>
</div>
</body>
</html></div>
<h2 style="color: black; text-align: left; margin-bottom: 10px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">咱们</span>来<span style="color: black;">瞧瞧</span>效果图:</p>
</h2>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://pic3.zhimg.com/80/v2-56a5437dc99abfb16f8694a0b0d8f7b6_720w.webp" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">经过</span>示例,<span style="color: black;">能够</span><span style="color: black;">晓得</span>:<span style="color: black;">这儿</span>实现字体加粗效果<span style="color: black;">重点</span>用到了css中的font-weight:bold;和font-weight:bolder;的样式属性。<span style="color: black;">咱们</span>应该<span style="color: black;">晓得</span>font-weight属性<span style="color: black;">能够</span>设置文本字体的粗细,而设置bold属性值<span style="color: black;">能够</span>定义粗体字符,bolder属性值<span style="color: black;">能够</span>定义更粗的字符,<span style="color: black;">从而</span>实现字体加粗效果。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在css font-weight属性中<span style="color: black;">不仅</span><span style="color: black;">仅有</span>bold属性值和bolder属性值<span style="color: black;">能够</span>加粗字体,还设置数值来加粗字体,<span style="color: black;">咱们</span>来<span style="color: black;">瞧瞧</span>效果:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>css 字体加粗</title>
<style>
.a1{
font-weight:bold;
}
.a2{
font-weight:800;
}
</style>
</head>
<body>
<div>
<p>这是一段测试文字<br /><br />
<span class="a1"><span style="color: black;">这儿</span><span style="color: black;">运用</span>bold属性值加粗字体</span><br /><br />
<span class="a2"><span style="color: black;">这儿</span><span style="color: black;">运用</span>数值加粗字体</span>
</p>
</div>
</body>
</html></div>
<h2 style="color: black; text-align: left; margin-bottom: 10px;">效果图:</h2>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://pic2.zhimg.com/80/v2-8c3b4c58f02b628d4b184829739077ed_720w.webp" style="width: 50%; margin-bottom: 20px;"></div>
<h2 style="color: black; text-align: left; margin-bottom: 10px;">说明:</h2>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">font-weight属性用于设置<span style="color: black;">表示</span>元素的文本中所用的字体加粗。数字值 400 相当于 <span style="color: black;">重要</span>字 normal(标准字体),700 等价于 bold(粗体)。<span style="color: black;">每一个</span>数字值对应的字体加粗<span style="color: black;">必要</span><span style="color: black;">最少</span>与下一个最小数字<span style="color: black;">同样</span>细,<span style="color: black;">况且</span><span style="color: black;">最少</span>与下一个最大数字<span style="color: black;">同样</span>粗。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">总结:以上<span style="color: black;">便是</span>本篇<span style="color: black;">文案</span>所介绍的设置字体加粗样式的<span style="color: black;">所有</span><span style="color: black;">办法</span>,<span style="color: black;">大众</span><span style="color: black;">能够</span>自己动手尝试,加深理解,<span style="color: black;">按照</span><span style="color: black;">必须</span>在<span style="color: black;">区别</span><span style="color: black;">状况</span>给css font-weight属性设置<span style="color: black;">区别</span>的值来给字体加粗。<span style="color: black;">期盼</span>能对<span style="color: black;">大众</span>的学习有所<span style="color: black;">帮忙</span>,更多<span style="color: black;">关联</span>教程请关注我!!!</p>
感谢你的精彩评论,带给我新的思考角度。 论坛的成果是显著的,但我们不能因为成绩而沾沾自喜。 交流如星光璀璨,点亮思想夜空。 对于这个问题,我有不同的看法... 交流如星光璀璨,点亮思想夜空。 感谢你的精彩评论,带给我新的思考角度。
页:
[1]