The difference between em and strong can be discussed from three levels. First, let’s look at the instructions in HTML 4.01: EM: Indicates emphasis. em expresses emphasis, strong expresses a stronger emphasis. It is concise and to the point, indicating the origin of the naming of em and strong. And in the browser, em is represented in italics by default and strong is represented in bold. This is the first level of difference. On the second level, a good summary was made in the two articles Emphasis in context versus overall highlighting and em vs. strong: em is for local emphasis. You see? Local emphasis. If you would emphasize a word in speech, use em. I feel that the above has been explained very clearly? Let’s take a look at the difference at the third level. A detailed explanation is given in the HTML5 draft: The em element represents stress emphasis of its contents. The placement of emphasis changes the meaning of the sentence. <p><em>Cats</em> are cute animals.</p> <p>Cats <em>are</em> cute animals.</p> <p>Cats are <em>cute</em> animals.</p> <p><strong>Warning.</strong> This dungeon is dangerous. It can be seen that the local emphasis and global emphasis mentioned at the second level are not accurate enough. The mystery of the difference between em and strong is vividly explained in the HTML5 draft. I recommend that you read the HTML5 draft carefully when you have time. There are many elements that are explained very clearly and are of great value for how we use the most appropriate labels in the most appropriate places. Finally, in the reply to the front-end and migrant workers’ articles, and in the emails received, I regret not to find anyone who knows the difference at the third level. Therefore, the gifts prepared (I really prepared 10 copies) were so lonely that I couldn't send them out. However, this article is just an introduction. Next, we will use a series of articles to explore the semantics of elements in HTML. The promise of gifts continues to be effective, leaving it to the next topic: Please explain the semantics of dl and list at least 5 usage scenarios. You can check the information, post the results in the reply, or send me an email. Gifts are limited, and the first 10 answers are correct must be given. Additional: I discussed it with some friends, and my final opinion is: em is a sentence that adding or not adding will cause semantic changes.
STRONG: Indicates stronger emphasis.
strong is for global highlighting. When somebody looks at your document, at a glance, certain words and phrases should jump out. These are the words and phrases t hat makes up the gist of the content — the highlights.
em is used for partial emphasis, while strong is global emphasis. Visually, em's emphasis is in sequence, and it will be noticed only when you read somewhere. The emphasis of strong is a random and unordered keyword sentence that is immediately highlighted when you see a certain article. Italics and bolds just satisfy these two visual effects, so they become the default styles of em and strong.
The strong element represents strong importance for its contents. Changing the importance of a piece of text with the strong element does not change the meaning of the sentenc e.
em represents the focus of the content (stress emphasis), strong represents the importance of the content (strong importance). strong will not change the semantics of the sentence where it is located, em will change the semantics of the sentence where it is located. And give a very good example:
Emphasizing cats discusses which animal is smart and cute.
The emphasis is, it is discussed whether cats are smart and cute.
Emphasizing cleverness and cuteness is a discussion of whether cats are smart and cute or stupid or annoying.
<strong>Avoid the ducks.</strong> Take any gold you find.
<strong><strong>Do not take any of the diamonds</strong>,
They are explosive and <strong>will destroy anything within
ten meters.</strong></strong> You have been warned.</p>
strong means an emphasis on importance and will not cause changes in the meaning of the sentence. Finally, pay attention to how heavy both em and strong can have. For example, it is important to use two strong to express the content.
Strong emphasizes importance, and has nothing to do with local or global. It is also possible to emphasize strong locally. Strong emphasizes importance and will not change the meaning of the sentence.