+ 10
<strong> and <b> and also <em> and<i>
Is it OK to use one in place of the other?
10 Respuestas
+ 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.
+ 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.
+ 6
Both tags are essentially defined the same way so, yes.
+ 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/
+ 3
yeah it does thanks
+ 3
yeah sometimes
+ 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☺️☺️.
0
if they do the same thing, then why did they make two codes and not one ?
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.
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