I’ve been learning about semantic HTML, and I keep reading how tags like <i> and <b> should be avoided. But if I don’t want to emphasize something, but just bold it visually, why would <b> be any worse than <span class="bold">? What are some advantages to using the more verbose <span class="bold"> syntax?
I’ve been learning about semantic HTML, and I keep reading how tags like <i>
Share
The issue with
bandielements is that they are not semantic, that is, they are about how things should look, not what they mean.<span class="bold">is actually no better, as it is also all about how something should look and is embedded in the page (a class name “bold” is not semantic either). It is better to use meaningful class names.There are semantic tags, such as
strongthat are better.As for class names – using a descriptive name is preferred – so
<span class="sub-header">is better than<span class="bold">, as it has meaning.