3 ms·
I always found the deprecation of the <b> element to be one of the most pedantic arguments. The given option to either swap the tag for something more descript
by legitster 2y ago
I always found the deprecation of the <b> element to be one of the most pedantic arguments.
The given option to either swap the tag for something more descriptive or move it to CSS are contradictory. (I understand not wanting to rely on it for header information).
I just want to make the text bold, dangit. I am not writing an essay about how the text is feeling.
- nabla9 2y agoUse the font-weight as suggested. HTML should be used to structure and semantics, not to define content's appearance. HTML can be converted into audio for blind people, used trough text terminal, used in many ways we don't expect.
- legitster 2y agoThe suggested replacements, <em> and <strong>, also define content's appearance and already have robust screen readers support. There's no practical reason <b> needs to be any different.
- nabla9 2y agoexcept semantics.
- deleted 2y ago[deleted]
- thayne 2y agoSuppose you want to bold something for stylistic reasons. <strong> isn't right, because the boldness isn't really for a strong emphasis, and you don't really want a screen reader to treat it differently. You could use <span class="bold"> or <span style="font-face: bold;">, but that's just a more verbose version of <b>.
- nabla9 2y ago> Suppose you want to bold something for stylistic reasons. The whole point of the article is that you should use css for style and html for structure and semantics. Don't use markup for style. Have separate css file for that. If you don't care or understand why that makes sense, just use bold.
- thayne 2y agoBut it is unavoidable to have to use markup for style. You have to use some markup to indicate the span that needs to be bold. Yes, you could use a <span> instead, but that is still using html for style, and conveys less about the purpose of the tag.