+ 10

<strong> and <b> and also <em> and<i>

Is it OK to use one in place of the other?

24th Jul 2018, 2:16 AM
Racheal Ifeoluwa Ogunmodede
Racheal Ifeoluwa Ogunmodede - avatar
10 odpowiedzi
+ 12
Short Answer: It gives same output in many modern desktop browsers, but it is practically discouraged & semantically incorrect. Long Answer: <strong> & <em> are semantic elements. In the HTML5 specification, they denote important text & emphasized text, respectively. On the other hand, <b> and <i> do not add any semantic value to their innerHTML. They are often used for non-specific purpose, like <i> is used for icons. Although most browsers display <strong> as bold and <em> as italic, it is not semantically correct to use them for styling. In fact, it is a good practice to do all styling with CSS. Styling tags, inline styles and inline scripts should be avoided as much as possible, because they make the code less readable, comprehendable & manageable.
24th Jul 2018, 10:17 AM
DAB
DAB - avatar
+ 7
Yes, It doesn’t matter which one you use if you’re just doing it for looks. Look at the comments in the HTML lesson with those tags in it. Like ᠌ "᠌ ᠌᠌ ᠌ ᠌" said just use CSS for styling. Which you should learn next. After I put the emojis/characters above my iPad has been crashing whenever I keep trying to get into this discussion. Is that happening with anyone else when they go into this discussion? It doesn't do it on pc.
24th Jul 2018, 2:43 AM
Noah Garza
Noah Garza - avatar
+ 6
Both tags are essentially defined the same way so, yes.
24th Jul 2018, 3:26 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 4
Nishat Nuha They don't do the same thing. Taken from the HTML Living Standard (https://html.spec.whatwg.org/multipage/text-level-semantics.html) : The b element represents a span of text to which attention is being drawn for utilitarian purposes without conveying any extra importance and with no implication of an alternate voice or mood, such as key words in a document abstract, product names in a review, actionable words in interactive text-driven software, or an article lede. The strong element represents strong importance, seriousness, or urgency for its contents. Please look at the official documentation and standard by WHATWG for detailed description. https://html.spec.whatwg.org/multipage/
25th Jul 2018, 9:18 AM
DAB
DAB - avatar
+ 3
yeah it does thanks
24th Jul 2018, 3:11 PM
Racheal Ifeoluwa Ogunmodede
Racheal Ifeoluwa Ogunmodede - avatar
+ 3
yeah sometimes
24th Jul 2018, 6:19 PM
🐯🐯Gimba Abdul Aziz🐯🐯
🐯🐯Gimba Abdul Aziz🐯🐯 - avatar
+ 1
Strong is used for text that has importance and also makes text bolder. Bold is used for just making text bolder. Italic is used for making text italic. Whereas emphasize is used for making text italic and displaying text that has importance. Hope this helps☺️☺️.
24th Jul 2018, 12:21 PM
Meet Mehta
Meet Mehta - avatar
0
if they do the same thing, then why did they make two codes and not one ?
25th Jul 2018, 8:55 AM
Nishat Nuha
Nishat Nuha - avatar
0
Yes, they are different tags but they perform the same function so I guess you can use them in place of each other. I suggest you learn CSS because it is a better way to do this.
25th Jul 2018, 12:22 PM
Tunwase Ayobami
Tunwase Ayobami - avatar
0
yes <strong> and <b> are used to highlat the text where as <em> and <i> are used to note that it is an important text
25th Jul 2018, 1:44 PM
Dare$devil
Dare$devil - avatar