The elements b and strong have co-existed for a long time by now. In strong0, which has been superseded by HTML5, strong was meant to be used for "strong emphasis", i.e. stronger emphasis than the em element (which just indicated emphasis). In strong1, strong "represents strong importance, seriousness, or urgency for its contents"; the aspects of "seriousness" and "urgency" are new in the specification compared to HTML 4.01. So if you used b to represent content that was important, serious or urgent, it is recommended that you use strong instead. If you want, you can differentiate between these different semantics by adding meaningful class attributes, e.g. <strong class="urgent">...</strong> and <strong class="warning">...</strong> and use appropriate CSS selectors to style these types of "emphasis" different, e.g. using different colours and font sizes (e.g. in your CSS file: strong.warning { color: red; background-color: transparent; border: 2px solid red; }.).
b的另一种替代方案是 em元素,它在 HTML 5.2中“表示内容的强调重点”。注意,这个元素通常用斜体表示(因此经常被推荐作为 i元素的替代品)。
我会抵制诱惑,按照其他一些答案的建议来写类似 <strong class="bold">...</strong>的东西。首先,class 属性在非视觉环境中没有任何意义(听一本 ePub 的书,一般的文本对话,屏幕阅读器,盲文) ; 其次,维护代码的人需要阅读实际的内容来找出 为什么的粗体。