The strong tag is one of the main text structuring tools in the HTML language. In this article, we will discuss how to properly use this tag to get neat and readable markup of web page text. Also consider the difference between formatting and text structuring tags.
Bold text with <strong>
The html <strong> tag is used to make the selected text bold. It is paired; accordingly, it requires a second closing tag.
The syntax when used will look like this:
<strong> </strong>
There is nothing difficult to use this tag, it has no attributes, it is used only on its own. However, there are some nuances that distinguish it from tags that give a visually similar effect.
<b> and <strong> tags - what are the differences?
Try to open any text editor and type in the following code:
<strong> 1</strong> <b> 2</b>
Save the file with .html permission and open in any browser. You will see that the result is exactly the same. The question arises: in which cases use one tag, and in which - another, and is there a difference?
The difference does exist. The <b> tag is only responsible for the visual formatting of the text, that is, it shows how the selected passage will look in the browser. And, accordingly, the browser itself is perceived only visually, without any additional semantic load.
But the html <strong> tag has more functionality. This is a text structuring tool.
In addition to the visual effect, it allows search engines to rank the formatted text higher, so it is recommended to use this tag to optimize the website.
This tag is also perceived by Text-to-Speech systems, which is important for more correct intonation.
When creating a site, it is recommended to use the html <strong> tag (and the <em> tag corresponding to italics) if you want to select small fragments of text, or use CSS tools when formatting large blocks.