Difference between strong and bold tag in HTML
The HTML <strong> tag is used semantically to emphasize importance, conveying meaning to both sighted and screen readers. In contrast, the <b> tag is solely for visual presentation, making text bold without conveying significance.
Table of Content
- HTML strong tag
- HTML bold tag
- Difference between strong and bold tags in HTML
HTML strong tag
The strong tag is one of the elements of HTML used in formatting HTML texts. It is used to define text with strong importance, often displayed in bold, contributing to both visual styling and semantic emphasis within the document structure.
Syntax:
<strong> Contents... </strong>
Example: In this example, we demonstrate the use of the <strong> tag to emphasize “Computer science” within a sentence, typically displayed in bold for strong importance.
<!DOCTYPE html>
<html>
<head>
<title>Strong Tag Example</title>
</head>
<body>
<h2>Using Strong Tag</h2>
<p>w3wiki a
<strong>Computer science </strong>
Portal.
</p>
</body>
</html>
Output:
HTML bold tag
The HTML <b> tag defines text to be displayed in bold without conveying additional semantic significance or importance within the document structure.
Syntax:
<b> Contents... </b>
Example: In this example demonstrates the use of the <b> tag to style “bold text” within a paragraph, visually emphasizing it.
<!DOCTYPE html>
<html>
<head>
<title>Bold Tag Example</title>
</head>
<body>
<h2>Using Bold Tag</h2>
<p>This is
<b>bold text</b>
within a paragraph.
</p>
</body>
</html>
Output:
Difference between strong and bold tags in HTML
strong tag | bold tag |
The <strong> tag is used to define text with strong importance | The bold (<b>) tag specifies bold text without any extra importance. |
The text inside this tag is bold | It makes any text bold. |
Conveys importance for both sighted and screen readers. | Provides no semantic meaning for screen readers. |
Contributes to SEO by signaling importance to search engines. | Doesn’t convey importance, less helpful for SEO. |
Encouraged for emphasis with importance. | Primarily used for visual styling without semantic implications. |
Supported Browser: The browser supported by <b> and <strong> tag are listed below.
Contact Us