如何减少内联 H2 标题的 font-weight - 最佳实践
How to reduce the font-weight of an H2 heading inline - best practices
我在网站上显示了以下文字
<h2 font-weight="33">H2 Heading which I want thinner</h2>
上面的方法不行。
<h2><font-weight="33">H2 Heading which I want thinner</font></h2>
我知道我可以像这样使用 CSS:
h2 {
font-weight: bold;
color: #fff;
font-size: 24px;
}
但我已经有几个复杂且不同的内部和外部现有 css,因此需要覆盖它 in-line。
使H2标签变薄的最佳方法是什么。我也问这个问题是因为我读到 font-weight 在 html5 中贬值了。
我们将不胜感激符合现代要求的最佳实践和解决方案。
试试这个:
<h2 style="font-weight: 33">H2 Heading which I want thinner</h2>
我在网站上显示了以下文字
<h2 font-weight="33">H2 Heading which I want thinner</h2>
上面的方法不行。
<h2><font-weight="33">H2 Heading which I want thinner</font></h2>
我知道我可以像这样使用 CSS:
h2 {
font-weight: bold;
color: #fff;
font-size: 24px;
}
但我已经有几个复杂且不同的内部和外部现有 css,因此需要覆盖它 in-line。
使H2标签变薄的最佳方法是什么。我也问这个问题是因为我读到 font-weight 在 html5 中贬值了。
我们将不胜感激符合现代要求的最佳实践和解决方案。
试试这个:
<h2 style="font-weight: 33">H2 Heading which I want thinner</h2>