<strong> Tag in HTML
Overview
The strong tag in HTML plays an important role in creating effective, readable, and attractive web pages. The strong tag in HTML indicates that the text or elements inside it have strong importance, seriousness, or urgency. The strong tag in HTML is a phrase tag, and browsers typically render the contents of the bold tag in HTML in bold type.
Syntax
The syntax of the strong tag in HTML is very simple. We need to open the strong tag, provide the content to be emphasized, and then close the strong tag.
The content in between the strong tag in HTML gets a strong emphasis.
Refer to the below-mentioned article to learn more about different HTML tags.
Attributes
The strong tag in HTML supports all the Global Attributes like accesskey, class, content editable, contextmenu, data - *, dir, draggable, dropzone, hidden, id, lang, spellcheck, style, tabindex, title, translate.
Apart from the above-mentioned global attributes, the strong tag in HTML also supports the Event Attributes in HTML like onafterprint, onbeforeprint, onbeforeunload, onerror, onhashchange, onload, onmessage, onoffline, ononline, onpagehid, onpageshow, onpopstate, onresize, onstorage, onunload etc.
Note: There are no attributes that are specific to the <strong> tag. It only supports the Global Attributes and the Event Attributes.
How to use <strong> tag in HTML?
The strong tag in HTML indicates that the text or elements inside it have strong importance, seriousness, or urgency. The strong tag in HTML is used to give the text a strong emphasis. The elements present inside the strong tag are referred to as strong elements.
Whenever we use the strong tag in HTML, the browser usually displays the strong tag element with the following default CSS values :
The strong tag in HTML is found inside the body tag in HTML. We generally use the strong tag in HTML to separate the content inside the strong tag from the rest of the content by bolding the content of the strong tag in HTML. We can also use the CSS or Cascading Style Sheets to change the behavior of the text.
Note:
- We can also use the <b> tag in HTML to bold the content but the <b> tag will only make the content bold without making the content important.
- We can also use the <em> tag in HTML, but the <em> tag will only emphasize the text but not make the content bold.
<b> Tag Vs <strong> Tag with Example
The <b> tag in HTML is used to bold the content. The <b> tag will only make the content bold without making the content important. On the other hand, the <strong> tag is used to emphasize the text. The elements present inside the strong tag are referred to as strong elements.
The default CSS for the <b> tag in html is :
The default CSS for the <strong> tag in html is also the same as the <b> tag in html :
Let us take the example of the <b> tag and the <strong> tag to better understand the context.
Example of <b> tag
Output
Example of <strong> tag:
Output
< em > Tag Vs < strong > Tag with Example
In the previous section, we have seen the use case and example of a strong tag in HTML. The strong tag is used to give the text a strong emphasis. The elements present inside the strong tag are referred to as strong elements.
On the other hand, the <em> tag in HTML is used to emphasize the text. The elements present inside the em tag are displayed in italic.
The default CSS for the <em> tag in html is :
Let us take the example of the <em> tag and <strong> tag to understand the context better.
Example or <em> tag
Output
Example of <strong> tag
Output
Examples
Let us take some examples of strong tags in HTML to understand the working of strong tags better.
Simple Usage
Output
Labeling Warning
Output
Browser Support
The following browsers support the strong tag in HTML:
- Chrome
- Android
- Safari
- Safari Mobile
- Edge (formerly known as Internet Explorer)
- Edge Mobile
- Opera
- Opera Mobile
- Firefox
- Firefox Mobile
Conclusion
-
The strong tag in HTML plays an important role in creating effective, readable, and attractive web pages. The strong tag in HTML is a phrase tag, and browsers typically render the contents of the bold tag in HTML in bold type.
-
The strong tag in HTML indicates that the text or elements inside it have strong importance, seriousness, or urgency.
-
The syntax of the strong tag in html is very simple :<strong>...content...</strong>.
-
There are no attributes that are specific to the <strong> tag. It only supports the Global Attributes and the Event Attributes.
-
We can also use the <b> tag in HTML to bold the content but the <b> tag will only make the content bold without making the content important.
-
We can also use the <em> tag in HTML, but the <em> tag will only emphasize the text but not make the content bold.
Related Tags
Learn more about the related tags in HTML :
Want to learn more about the tags mentioned above and more? Refer to the article: HTML Tags - Scaler Topics