如何减少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,因此需要在内部重写它。

使H2标签更薄的最佳方法是什么。我也问这个问题,因为我读到html5中的font-weight已贬值。

最好的做法和符合现代要求的解决方案。

解决方法

尝试一下:

<h2 style="font-weight: 33">H2 Heading which I want thinner</h2>