Learning how to code is intriguing and challenges are what make the whole adventure exciting. If web development is what you’re planning to get into, HTML is where the journey starts. One of the biggest questions for beginners at the initial stages is “should I use <b> or <strong> ?“
What’s the difference between <b>, and <strong> in the first place? After all, the three elements do exactly the same thing, at least visually. These are the two most important questions about these two HTML5 elements.
Lets first start by defining what <b> and <strong> elements do. You guessed it right, they all make enclosed text have a certain default styling (boldface). Using the two along with text makes the text bold. In most browsers, this is the case, but you might notice some differences in old browsers. Some old browsers indicate a text unfer the <strong> element by underlining.
So lets define how each element mean in HTML.
The strong HTML element is used to show text of great importance. It does so by making the targeted text bold, so it stands out from the rest. The semantic meaning of elements is very important in HTML. According to the latest iteration of HTML, version 5,<strong> presents “strong importance for its contents.”
The <b> and <strong> element is where all the confusion lies. But the distinction between the two isn’t hard to wrap your head around it if you understand the meaning of each. Let me show you how the two stand out from each other.
As indicated above, the <strong> element is nested inside other elements to indicate something of greater importance. So the <strong> element is partially aimed at catching your attention to the enclosed text.
And when it comes to the <b> element, its mainly used to draw a reader’s attention to the selected part of the text – without indicating it’s of great importance in any way. It’s simply meant to draw eyeballs to it but doesn’t mean that the text is of any great importance. That is the difference between the two elements.
But the bottom-line is, <b> is used for bolding texts. That is why it’s recommended that you use dedicated styling techniques like the CSS font-style property.
The main differentiator between <b> and <strong> is their meaning. Once you’ve mastered the meaning of each element, you’ll have no hard time dealing with the two.