HTML Bold Tag

HTML bold tag is represented by <b> tag. HTML <b> tag is used to display the written text in bold format. It is strictly a presentational element. If you want to show your text in bold letters and not have real semantic meaning, put it within <b>.......</b> tag.

  • We can use <b> tag in HTML to present any important text boldly.
  • HTML <b> tag comes under the category of presentational tag and should not be mistaken for semantic because it is purely for text presentation. And it will not specify any special meaning.
  • <b> tag makes content visually bold enclosed in it and specifies no significant meaning
  • In case of specifying any important message or meaning, we can use <strong> tag instead of <b> tag as <strong> tag is a semantic one.
  • While the <b> tag is as yet used and supported in HTML, it's good to utilize CSS for styling messages, as it isolates showing from content and gives more command over styling.

Difference between HTML <b> and <strong> Tag

The <b> tag is explicit, whereas the strong tag is semantic. The <strong> tag adds extra semantic meaning to the HTML document. It is recommended to use <strong> tag for bold format.

<b> Tag

  1. It is a presentational tag
  2. Used for styling and visualization
  3. No semantic meaning

<strong> Tag

  1. It is a semantic tag and has a specific meaning enclosed within the tag.
  2. Emphasized text will be used for <strong> tag
  3. It is also a visualization and styling tag

Examples of HTML Bold Tag

Code:

HTML bold tag example

Test it Now

Output:

Hello guys, this is the method to write bold text.

NOTE: According to HTML5 specification, b tag should be used only if no other tag is appropriate. For example, If you want to write a heading, use the header tag <h1> to <h6>. Important statements should be denoted within <strong>.....</strong> tag, and the text you want to mark or highlight must be put within <mark>...</mark> tag.

There is also a CSS 'font-weight' property to set bold text. The font-weight CSS property is one more method for setting text as strong or boldly in HTML, and it offers all the more fine-grained command over the level of strength. This is the way it connects with the <b> and <strong> labels:

Example 1:

Output:

This is a bold content 

Example 2: Nested Bold Tag

Code:

Output:

Javatpoint offers  Technical Content and Articles   

Example 3: List Items

Code:

Output:

    
  • Item 1 : Java Programming Language
  • Item 2 : Web Development
  • Item 3 : HTML CSS Javascript

Example 4: Combining other tags

Code:

Output:

    

This is the bold and italic text content

This is the bold and underlined text content

Example 5: Bold Header

Code:

Output:

    

This is an example of bold header

Normal header content

Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<b>YesYesYesYesYes

Note: HTML b tag also supports the global and event attribute in HTML.


Next TopicHTML base Tag




Latest Courses