字体粗细不适用于 Chrome 中的标签
我的代码中有这一行:
<label style="font-weight: bold" for="sedii18n_codice_paese_indirizzo">Codice paese indirizzo</label>
但标签显示正常。
如果我转到 Chrome 检查器,我可以看到以下内容:
font-weight: normal !important;
如果我在检查器中更改 font-weight
,则字体的粗细会正常修改。
I have this line in my code:
<label style="font-weight: bold" for="sedii18n_codice_paese_indirizzo">Codice paese indirizzo</label>
but the label is showed normal.
If I go to the Chrome Inspector I can see this:
font-weight: normal !important;
If I change font-weight
in the inspector the weight of the font is modified normally.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看起来其他东西压倒了你的大胆风格,因此 !important 标签。 Chrome Inspector 应该告诉您
font-weight: normal !important;
的应用位置。您可以尝试将font-weight: bold !important;
放入样式属性中以覆盖此覆盖。 :-)Looks like something else is overriding your bold style, hence the !important tag. Chrome Inspector should tell you where the
font-weight: normal !important;
is being applied. You can try puttingfont-weight: bold !important;
inside your style attribute to override this override. :-)您是否查看过检查器中活动元素的右上角?
您可以找到哪个样式表正在覆盖您的代码
have you take a look on the top right corner of your active element in the inspector?
You can find which stylesheet is overwriting you code
您可以为标签标签创建一个单独的 .css 文件,并按如下方式提及: -
.lbl { font-weight : normal; }
html 文件内部: -
这对我有用,并且在 google 中被覆盖铬合金。
You can create a separate .css file for label tag and mention it as below: -
.lbl { font-weight : normal; }
Inside html file: -
<label class = "lbl" for="sedii18n_codice_paese_indirizzo">Codice paese indirizzo</label>
This is working for me as well as overridden in google chrome.