HTML bold - how to use <b> tag

The <b> tag defines text that will be displayed in bold format. The text marked as bold does not convey any special importance. There are few other tags like <strong>, <emph> and <mark> that serves similar purpose and it is preferred to use <b> tag as a last option.

Common mistakes while <b> tag includes marking it as header but instead the heading tags - h1-h6 - should be used instead. Also, <strong>, <emph> and <mark> tags have semantic meanings which the <b> tag does not have. Therefore, it is better to limit the use of <b> tag and instead use the style font-weight:bold instead.


The b tag supports the global and event attributes.


<!--using the <b> tag--> <div> <p>HTML is a <b>markup</b> language.</p> </div> <!--using styles to achieve bold format--> <div> <p>HTML is a <span style="font-weight:bold">markup</span> language.</p> </div>