여태껏 두 요소의 차이점을 제대로 모르고 있었다.
둘 다 강조하고 싶은 컨텐츠에 사용하는 요소라고 대강 알고 있었는데 이번에 다시 알아보기로 했다.
먼저 strong요소에 대해 알아보기 위해 w3에 있는 문서의 설명글을 확인해 봤다.
The strong element represents strong importance, seriousness, or urgency for its contents.
Importance: The strong element can be used in a heading, caption, or paragraph to distinguish the part that really matters from other parts that might be more detailed, more jovial, or merely boilerplate.
For example, the first word of the previous paragraph is marked up with strong to distinguish it from the more detailed text in the rest of
the paragraph.
Seriousness: The strong element can be used to mark up a warning or caution notice.
Urgency: The strong element can be used to denote contents that the user needs to see sooner than other parts of the document.
The relative level of importance of a piece of content is given by its number of ancestor strong elements; each strong element increases the importance of its contents.
Changing the importance of a piece of text with the strong element does not change the meaning of the sentence.
여기까지는 w3에 있는 설명글이다.
mdn에는 어떻게 설명되어 있는지 확인해봤다.
The HTML Strong Importance Element (
<strong>
) indicates that its contents have strong importance, seriousness, or urgency. Browsers typically render the contents in bold type.
The (
<strong>
) element is for content that is of "strong importance," including things of great seriousness or urgency (such as warnings). This could be a sentence that is of great importance to the whole page, or you could merely try to point out that some words are of greater importance compared to nearby content.
Typically this element is rendered by default using a bold font weight. However, it should not be used simply to apply bold styling; use the CSS font-weight property for that purpose. Use the
<b>
element to draw attention to certain text without indicating a higher level of importance. Use the<em>
element to mark text that has stress emphasis.
Another accepted use for
<strong>
is to denote the labels of paragraphs which represent notes or warnings within the text of a page.
다음은 em 요소에 대해 알아보기 위해 w3에 있는 문서의 설명글을 확인해 봤다.
The
<em>
element represents stress emphasis of its contents.
The level of stress that a particular piece of content has is given by its number of ancestor em elements.
The placement of stress emphasis changes the meaning of the sentence. The element thus forms an integral part of the content. The precise way in which stress is used in this way depends on the language.
The em element isn’t a generic "italics" element. Sometimes, text is intended to stand out from the rest of the paragraph, as if it was in a different mood or voice. For this, the i element is more appropriate.
The em element also isn’t intended to convey importance; for that purpose, the strong element is more appropriate.
여기까지는 w3에 있는 설명글이다.
mdn에는 어떻게 설명되어 있는지 확인해봤다.
The
<em>
element is for words that have a stressed emphasis compared to surrounding text, which is often limited to a word or words of a sentence and affects the meaning of the sentence itself.
<em>
요소는 주위 텍스트에 비해 강조된 부분을 나타냅니다. 보통 한 문장에서 단어 하나 혹은 몇 개로 제한되며, 문장의 의미에 영향을 미칠 수 있습니다. strong은 중요성,심각성,긴급성이 있는 부분에 쓰는 것이고 문장의 의미를 바꾸지 않는다.
em은 컨텐츠에서 강세를 주고싶은 부분에 쓰는 것이고 문장의 의미를 바꾼다.
여기서 문장의 의미를 바꾼다는게 명확히 이해가 잘 안되는데
w3에 있는 example을 보니
<p><em>Cats</em> are cute animals.</p>
By emphasizing the first word, the statement implies that the kind of animal under discussion is in question (maybe someone is asserting that dogs are cute)
<p>Cats <em>are</em> cute animals.</p>
Moving the stress to the verb, one highlights that the truth of the entire sentence is in question (maybe someone is saying cats are not cute):
실제 대화에서도 "어제 9시에 잠들었어" 라는 말을 한다고 하면
"9시에"에 힘을 줘서 말하면 잠든 시간이 10시,12시,2시가 될 수도 있었지만 9시였다는걸 강조하는 것이고 "잠들었어"에 힘을 줘서 말하면
9시에 공부를 했을 수도 있고 운동을 했을 수도 있고 밥을 먹을 수도 있었지만 잠이 들었다는 걸 강조해서 말하는 .. 뭐 이런느낌인 것 같다.