Hey Ashley! I’ve been trying to learn HTML, and I noticed that it taught me some formatting that I’m not used to like bold and italic being (well I forgot) but I think bold was <b>. And I know bold is in the normal editors. So what’s the difference of the usage and can you mix both up!
Thanks Ashley! You’re awesome.
Hiya! 🙂 If I’m understanding you correctly, are you referring to these differences?
<b> vs <strong>
<i> vs <em>
For the sake of answering this, we’re going to group together <b> and <i>; and <strong> and <em>
<b> and <i> refer to styles. If you use <b> it means you want the text to look bold purely for stylistic reasons. Same goes for <i>. If you use that code, it means you want the text to be italicized purely for stylistic reasons.
However, you would use <strong> if you wanted that bit of text to look bold and have emphasis. That means it’s an important piece of information.
So why is there a difference?
In terms of you looking at the output on a page, there is no visual difference. They look exactly the same. The difference comes with text-to-speech programs, often used by blind people. When blind people look at a website, all the text is spoken to them. If you use <b>, the voice program will not do anything differently when reading that text. But if you use <strong>, the voice program might speak the text differently—with emphasis, or in a different tone of voice. This is done to convey to the blind person that the text is important in some way. Same goes for using <em>.
Also, using <strong> instead of <b> means you’re using Semantic Markup, which is best practice these days.
So here’s a good example: You remember in school when you were told italicize the titles of books? Well that’s purely for stylistic reasons. So that would be a good reason to use <i> because the title of a book doesn’t need emphasis, it’s just italicized to make it look a certain way.
But then let’s say you need to convey some important rules to someone when requesting a review, like this:
I accept review requests from authors but only if the book is Young Adult.
I want to put emphasis on the word “only” because it’s important, so that would be a case to use <em> instead of <i>.
I hope that answers your question!