The <strong>
Tag in HTML
Concept
The <strong>
tag in HTML is used to define text that has strong importance within a document. It’s a way to emphasize certain words or phrases, making them stand out in the content. While visually, it often appears bold, the semantic meaning behind the <strong>
tag is what sets it apart from simply using the <b>
tag for bold text.
Implementation
Here’s an example of how you can use the <strong>
tag to emphasize a crucial part of a sentence:
<p>The new product launch is <strong>tomorrow</strong>, and we are all excited about it!</p>
powered by Advanced iFrame. Get the Pro version on CodeCanyon.
Most browsers will display the <strong>
element with the following default CSS setting:
strong {
font-weight: bold;
}
This CSS rule makes the text inside the <strong>
tag appears bold, but remember, the semantic importance of the text is the primary reason for using this tag. You can also use HTML <b>
tag.
Browser Support
Browser | Support |
---|---|
Chrome | Yes |
Firefox | Yes |
Safari | Yes |
Edge | Yes |
Internet Explorer | Yes |
Global Attributes
The <strong>
tag also supports the Global Attributes in HTML, allowing you to add additional information and styling to the element.
Event Attributes
You can also use Event Attributes with the <strong>
tag to define specific behaviours in response to user actions, such as clicks or mouse movements.
Conclusion
The <strong>
tag is a valuable tool in HTML for emphasizing text with strong importance. It’s more than just a visual cue; it conveys a semantic meaning that can be essential for accessibility and understanding the context of the content.