In this section, we will learn what HTML <b> element is all about.
How to Make Text Bold in HTML: <b> Tag
When putting a paragraph on a webpage, there are times that we want to bold part of that text in order to gain more attention! This is where we can use HTML <b> element.
HTML <b> element stands for bold and, as the name suggests, it is used when we want to bold a text on a webpage.
HTML <b> Tag Syntax:
<b> content </b>
HTML <b> Tag Values
The value we set within the body of this element is basically the content we want to gain more attention by becoming bold.
Example: HTML for bold text
See the Pen HTML for bold text by Omid Dehghan (@odchan1) on CodePen.
Example: bold text in HTML
See the Pen bold text in HTML by Omid Dehghan (@odchan1) on CodePen.
HTML Tags for Bold
Other than <b> element, there’s another HTML element called <strong> which basically bolds a text content just like the way <b> element does. But HTML <strong> element puts semantic importance to the content within its body.
Basically, on appearance you won’t see any differences but for SEO reasons, using <strong> over <b> element has more advantages.
Font bold in HTML
Other than using HTML <b> and <strong> elements to bold a text in a document, we can use CSS font-weight property to bold a text in a document as well. Check the CSS font-weight Property section for more information.
Example: HTML style font bold
See the Pen HTML style font bold by Omid Dehghan (@odchan1) on CodePen.