html - 我可以设置字体粗细吗
问题描述
我需要使用标签或 .h5 引导类来增加字体大小,但我不希望文本加粗。
<p class="h5 font-weight-light">Whatever</p>
和
<h5 class="font-weight-light">Whatever</h5>
和
<h5 style="font-weight: 300">Whatever</h5>
对我不起作用。他们都很大胆。
你知道如何让它工作吗?
解决方案
您缺少 !important 使该样式处于活动状态,因此:
<h5 style="font-weight:300 !important;">Whatever</h5>
最好将该 CSS 放在一个单独的文件中,而不是直接放在 html 中。
直接设置字体大小就不需要h5了。
style { font-size: 2rem ; }
推荐阅读
- .net-core - xunit 集成测试永远不会在 .net 核心 github-actions 上结束
- python - In 运算符在输入变量时不起作用,在分配值时起作用
- python - Django 2.2 | 匿名用户打开站点时不会创建名称为“sessionid”的 Cookie
- php - 当表单字段包含“和 1”时,PHP POST 403 错误被禁止
- android-studio - 我在 android studio 中的 build.gradle 文件出错
- mongodb - Kubernetes(Istio) Mongodb 企业集群:HostUnreachable: Connection reset by peer
- mysql - MySQL搜索和替换特定字符组合
- javascript - 在推送新值之前查找重复项
- regex - 如何在这个正则表达式中允许连字符?
- ubuntu - 如何将域路由到 Apache 中 vs 代码服务器的 8080 端口