What is HTML Bold Element?
In HTML, <b>
(bold) element is used to display text in bold style in a webpage.
The bold element is purely presentational; it doesn't carry any specific semantic meaning on its own.
Example of Creating HTML Bold Text
Create an HTML <b>
element in a<p>
element.
Place the text 'an example of HTML bold text.' between the <b>
and </b>
tags as shown in the following example.
The text will be displayed in bold style in the following output.
Example of HTML Bold Element
Output of the above example
Examples of Bold Text
This is an example of HTML bold text.
<b> tag is used to display bold text
What is HTML Strong Element?
In HTML, <strong>
(strong) element is used to apply bold style with importance or emphasis in a webpage.
The strong element also indicates that the enclosed text is of strong importance from a semantic standpoint.
It is best practice to use the <strong>
element instead of <b>
when the intention is to convey importance or emphasis.
In the following example, the text 'consectetur adipiscing elit.' is enclosed with <strong>
element tag. The text will be display in bold style in the output.