The HTML <b> tag is an inline element that is used capture readers attention to it's content. This was once known as the Boldface element.
Syntax
<b>Text displayed in bold</b>
Example
<!DOCTYPE html>
<html>
<head>
<title>HTML b tag<title>
</head>
<body>
<p> Hello.. <b>This is Bold text.</b></p>
</body>
</html>
Output
Hello.. This is Bold text.
The <b> tag should not be confused with <strong> tag. We usually use <b>
tag to display names of something (Ex: name of a book) or a summary to draw the attention of a reader, but does not have have a special importance. On the other hand, <strong>
tag is used to display some text that has special importance.
You should not use <b>
tag to style the text. Instead, you should use the CSS font-weight
property.
Example
<p style="font-weight:bold">This text is bold</p>
Output
This text is bold