HTML B Tag
The <b> tag in HTML is used to make text appear bold. That’s its main job — to make whatever is inside it look visually bold on the screen.
The tag only changes the appearance of the text. It does not give any extra meaning to the content. That means search engines, screen readers, or accessibility tools won’t treat the bolded text as important — it's just styled that way.
Why Use the <b> Tag?
Here are a few situations where you might use it:
- To highlight keywords in a paragraph.
- To make certain words stand out in a product description or label.
- To add visual contrast in UI text, like form labels or alerts.
- To emphasize names, phrases, or headings without adding semantic meaning.
Syntax -
<b>..This text will appear bold</b>
Example -
Scenario - Example Using <b> Tag
<!DOCTYPE html>
<html>
<head>
<title>Bold text example.. </title>
</head>
<body>
<p>This is <b>bold</b> text</p>
</body>
</html>
Output -
This is bold text
Explaining Example -
In this example, we’re using <b> to highlight important text so that the reader can quickly skim and pick up key points.
Difference Between <b> and <strong>
This is where beginners often get confused. Both make text look bold, but they are used for different reasons.
Tag | Makes Text Bold? | Adds Meaning (Importance)? |
---|---|---|
<b> | Yes | No |
<strong> | Yes | Yes |