Select Page

How to use the HTML b element.


The b element is used to set a text to bold. The b stands for boldface. The text is written in between the opening and closing tags of the b element.


nanadwumor

May 27, 2023
HTML b element

Share this article

The b element is used to set a text to bold. The b stands for boldface. The text is written in between the opening and closing tags of the b element.

Syntax

The <b> tag is written as <b></b> with the text to bolden inserted between the opening and closing tags.  That’s is:

Join other Subscribers on our YouTube channel and enjoy daily pogramming tutorials.

Recommended


Example:

The b element has similar function to the strong element except that the strong element adds semantic meaning or significance to the text. The b element does not add any significance to the text except that it makes it bold. If you want to add any importance to the text, use the <strong> element.

Using the b element to bolden list of items

One typical situation you may use the b element is when you want to list some items and have them boldened in order to draw the reader’s attention to it yet, without need for any special importance added. Example:

Every programmer should learn to write good code in his chosen language such as  <b> Java, C, C++ , Python </b>  and many more.

Article lede: Using the b element to capture reader’s attention to main content of the article at the beginning.

In an article, the writer may want to arrest the attention of the reader at the very onset and let him know what his article is all about. To do that, he could use the <b> element to bolden the first few texts in the first paragraph.

Output

b element in html

Example of code demonstrates <b> tag

Output

b element in html example - villagecoder.com

Attributes

An attribute  of an html element  adds modification to the element and affects how the element behaves or appears.

Global Attributes

The b element supports global attributes.


Share this article


0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

You May Also Like…

Block And Inline Level Tags in HTML

Block And Inline Level Tags in HTML

Block elements start on a new line and end with a carriage return. That's, immediately after ending on a horizontal...

Selecting a browser for HTML5 development

Selecting a browser for HTML5 development

Google's Chrome browser is simple to use and has the most up-to-date HTML5 features making it easier for developers....

Top 10 HTML5 formatting tags

Top 10 HTML5 formatting tags

HTML offers a range of elements for formatting text. HTML formatting tags include : <b> - Bold text...