DEV Community

Cover image for HTML tags | strong-b
Carlos Espada
Carlos Espada

Posted on • Updated on

HTML tags | strong-b

<strong> is used to define a text that has great importance, seriousness or urgency, and is usually rendered visually in bold by the browser, while <b> is used exclusively to attract the attention of the reader by defining a text in bold, without no special importance.

Highly important content on a page can be a notice, a prominent phrase, or just a few words in the middle of a text.

Also the paragraph tags that represent notes or warnings within the text of a page. All of them will be marked with <strong>.

Do not confuse the use of <strong> with that of <em>, which is used to emphasize specific parts of a text (eg: <p> I <em>love</em> chocolate</p>).

<b> should be a last resort and only used when no other tag is available, never for styling. In case you want to use bold it is better to use the CSS font-weight property. If you want to indicate that the text it contains is of special importance then use <strong>.

Nor should you use <b> to highlight titles or headings, for that you will use <h1>-<h6> together with CSS.

Valid uses of <b> could be keywords in a summary, product names in a review, or other pieces of text whose typical presentation would be in bold but without adding special importance.

  • Type: inline / inline
  • Self-closing: No / No
  • Semantic value: No / No

Definition and example <strong> - Definition and example <b> | Support <strong> - Support <b>

Top comments (0)