HTML - <b> Tag
Introduction to <b> Tag
The HTML <b> tag is used to highlight the text and specify the text in bold; Making it stand out visually from the surrounding content. As it is a non-semantic element, it does not convey any additional meaning or importance other than the visual importance.
The <b> tag is generally used when you need to draw the attention to the specific text without indicating a stronger emphasis or importance, as would be conveyed by the <strong> tag.
Nowadays every modern web uses CSS for styling, but the <b> tag remains a simple and quick way to highlight text in bold.
Syntax
Following is the syntax of HTML <b> tag −.
<b> ... </b>
Attributes
HTML b tag supports Global and Event attributes of HTML.
Example : Simple Bold Text
In the following example, we are going to consider the basic usage of the <b> tag.
<!DOCTYPE html>
<html>
<body>
<p>This is normal para</p>
<p>
<b>This is bold paragraph </b>
</p>
</body>
</html>
Example : Combining with CSS
Consider the following example, where we are going to use the <b> tag and applying the CSS properties to it.
<!DOCTYPE html>
<html>
<head>
<style>
b {
color: red;
font-style: italic;
}
</style>
</head>
<body>
<p>
This article describes several <b>text-level</b>
elements. It explains their usage in an
<b>HTML</b> document.
</p>
Keywords are displayed with the default style
of the <b>element, likely in bold. </b>
</body>
</html>
Example : Without Using <b> Tag
In the following example, we are going to create a bold text without using the <b> tag.
<!DOCTYPE html>
<html>
<body>
<h2>Using CSS properties to set the bold text. </h2>
<p>
This is normal text - <span style="font-weight:bold;">
and this is bold text</span>.
</p>
</body>
</html>
Supported Browsers
| Tag | ![]() |
![]() |
![]() |
![]() |
![]() |
|---|---|---|---|---|---|
| b | Yes | Yes | Yes | Yes | Yes |




