W3docs

HTML <strong> tag

HTML <strong> tag is used to highlight the important parts of the text. Description, attributes and examples.

The <strong> tag highlights an important part of the text. It can be used for important content, such as warnings. It might be a single sentence that gives importance to the whole page, or it may be needed to highlight words that are more important than the rest of the content. Search engines treat the content as more important, and screen readers may use vocal emphasis when reading it aloud.

The <strong> tag is a phrase tag indicating that a text section has structural meaning.

The content of the tag is displayed as bold. Unlike the <b> tag, which specifies bold text, the <strong> tag is a part of semantic markup. The <b> tag is used to bring attention to the text without specifying that it is more important. In most browsers, the default styling for both the <b> and <strong> tags is the same. However, if you want to have bold text just for decoration, you should use the CSS font-weight property.

While HTML4 defined the <strong> tag as implying a stronger emphasis, HTML5 defines it as representing strong importance of the content.

Unlike the <em> tag, which conveys spoken emphasis, the <strong> tag indicates strong importance or urgency.

Tip

To differentiate the text in bold without taking into account its importance use the <b> tag or the CSS font-weight property.

Syntax

The <strong> tag comes in pairs. The content is written between the opening (<strong>) and closing (</strong>) tags.

Example of the HTML <strong> tag:

HTML <strong> tag

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    <p>We’ve used the <strong> tag to highlight this important part of the text.</p>
  </body>
</html>

Result

strong example

Attributes

The <strong> tag supports Global Attributes and the Event Attributes. For example, you can apply a class to style it differently:

<strong class="warning">Important notice</strong>

Practice

Practice

What does the HTML <strong> tag do?