Using the strong tag in HTML
The strong tag in HTML shows that its content is of serious importance, urgency. In browsers, the content highlighted with this element is displayed in bold/semibold type.
- The strong tag is for content that is of “great importance”: very serious; urgent; warning. It is also possible to apply the element to a sentence that has priority throughout the page, or to indicate certain words that should stand out in nearby content.
- Content in the strong tag is reflected in bold by default. However, it should not be used for this purpose. It is better to use the CSS
font-weight. To attract attention in the text use tag b, without specifying a higher level of importance. Use the em element to mark the text to be emphasized.
To draw <b>attention</b> in the text uses the b tag without specifying a higher level of importance. Use the em element to mark text that <em>needs</em> to be emphasized.
- The next acceptable use is to position paragraph labels that act as notes or warnings on the text on the page.
Using the tag strong or b
- New developers are often confused by the existence of a variety of ways to reflect the same thing on the rendered page. The b and strong elements prove to be some of the most common sources of confusion. As if they both don’t do the same thing?
In part. The strong element is intended for the highlighted part of the text, which has the highest importance, while the element b is used to draw attention to the content without making it important.
- Understanding that they both appear to be semantically valid tags in HTML (matching), but have the same default style (bold/bold) on pages in browsers. Each of them is intended to be used for certain types of scripts, and in order to make the text bold/semi-bold in beauty, you should use the CSS
Using a strong or em tag
- HTML4 defines the strong tag as indicating stronger importance. HTML5 defines a strong tag as representing “strong importance for its content.” This is a distinction that makes it clear.
The em tag is used to give verbal emphasis to the highlighted part of the text, while the strong tag is intended to give the part of the sentence additional importance.
The em tag is used to give <em>verbal emphasis</em> in the highlighted part of the text. The strong tag is intended to give the <strong>part of the sentence</strong> extra emphasis.
Therefore, both elements should be used for certain needs: to give meaning or emphasis, respectively.