HTML <b> Tag

Topic: HTML5 Tags Reference« Prev|Next »

Description

The <b> (short for bold) tag displays text in a bold style. This element typically renders the text it encloses in a bold typeface without conveying any extra importance.

The following table summarizes the usages context and the version history of this tag.

Placement: Inline
Content: Inline and text
Start/End Tag: Start tag: required, End tag: required
Version: HTML 2, 3.2, 4, 4.01, 5

Syntax

The basic syntax of the <b> tag is given with:

HTML / XHTML: <b> ... </b>

The example below shows the <b> tag in action.

  • <p>This <b>sentence</b> contains some <b>bold</b> words.</p>
  • <p>Here are <b>some</b> more <b>bold</b> words.</p>

Tag-Specific Attributes

The <b> tag doesn't have any specific attribute.


Global Attributes

Like all other HTML tags, the <b> tag supports the global attributes in HTML5.


Event Attributes

The <b> tag also supports the event attributes in HTML5.


Browser Compatibility

The <b> tag is supported in all major modern browsers.

Browsers Icon

Basic Support—

  • Firefox 1+
  • Google Chrome 1+
  • Internet Explorer 2+
  • Apple Safari 1+
  • Opera 2.1+

Difference between <b> and <strong> element

Both elements renders the text it encloses in a bold typeface, but the <strong> element which represents text of certain importance, the <b> element doesn't convey any semantic information about the contained text.

It is strongly recommended to avoid the use of <b> element; using CSS property font-weight with 'bold' value would be a better choice for making the text bold.


Further Reading

See tutorial on: HTML Text Formatting.

Related tag: <strong>.

 
Close

Your Feedback:

 

We would love to hear from you! Please say something.