Table of Contents
INTRODUCTION
The HTML <b> element is used to draw attention of users towards text which does not have any special significance or importance by visually highlight it. In short it is used to visually highlight any general text.
The contents of <b> element is shown by browser in bold text. But it should not be used to make any text bold, you can use the font-weight property for that purpose.
It is mostly used for keywords in summary, product name in review or any normal text in paragraph which is to be boldfaced but is not important.
Syntax:<b> --TEXT-- </b>
Example:
<p>
Inventors began to branch out at the start of the 19th century, creating the <b>de Rivaz engine</b>, one of the first internal combustion engines, and an early electric motor.
</p>
Inventors began to branch out at the start of the 19th century, creating the de Rivaz engine, one of the first internal combustion engines, and an early electric motor.
ATTRIBUTES
The HTML <b> element only has global attributes.
Usage Guidelines
- Historically, the <b> element was designed to render text in boldface. In HTML 4 it was deprecated in favour of CSS (font-weight: bold;) property for better separation of style and content. In HTML 5 this tag was redefined with a new role instead of being deprecated. Now, it is used for stylistic bolding without added importance
- Use the <b> tag for situations like highlighting keywords in a summary, displaying product names in a review, or emphasizing text that is typically bolded for styling purposes without adding extra significance.
- Do not use <b> element for titles and headings. You should use <h1>-<h6> elements.
- You can assign class to <b> element, so that you can style multiple <b> elements.
- To make text bold, you can use CSS font-weight property.
Tag Omission
The HTML <b> element must have both start tag and end tag.
Frequently Asked Questions (FAQ)
What is the Difference Between HTML b(bold) Tag and strong tag?
What is the Difference Between HTML b(bold) Tag and br tag ?
The <b> tag is used to make text bold.
The <br> tag is used to insert a line break, forcing text to move to a new line.
How to make text bold in HTML?
You can also use the CSS font-weight property with value as bold to make text bold (font-weight: bold).