好得很程序员自学网

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

css中不加粗怎么写

css中可 利用 font-weight 属性来让元素不 加粗 ,写法为“元素{font-w ei ght:normal;}”;font-weight属性用于设置文本的粗细样式,当值设置为“normal”时,元素会被设成标准字符样式,也就是不加粗的样式。

本教程操作环境:windows10系统、CSS3 && HT ML 5版、Dell G3 电 脑。

css中不加粗怎么写

在css中可以利用font-weight属性来给元素设置不加粗的样式,font-weight属性用于设置文本的粗细。

属性值如下图所示:

下面我们通过示例来看一下 怎样 使元素不加粗,示例如下:

<!DOCTY PE  html>
<html lang="en">
<head>
    < ;m eta charset="UTF-8">
    <meta n am e="viewport" content="width=device-width, in IT ial -s cale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie= Edge ">
    <title>Document</title>
    <style type="text/css">
p {font-weight: bold}
</style>
</head>
<body>
<p class="normal">这一段 不想 加粗</p>
<p>This is a paragraph</p>
<p>This is a paragraph</p>
</body>
</html>

输出结果:

此时并不想让其中一段话加粗,只需要给这段话添加font-weight: normal样式即可:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style type="text/css">
p {font-weight: bold}
p.normal {font-weight: normal}
</style>
</head>
<body>
<p class="normal">这一段不想加粗</p>
<p>This is a paragraph</p>
<p>This is a paragraph</p>
</body>
</html>

输出结果:

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

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

总结

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

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

查看更多关于css中不加粗怎么写的详细内容...

  阅读:22次