CSS:emとstrongの違い

2384 ワード

表現
em vs strong
ブラウザでは、はデフォルトで斜体で表示され、は太字で表示されます.スタイル表現から、がより際立っており、目を引きやすい.明らかに、このような視覚的な違いの設計には目的がある.
程度
EM: Indicates emphasis. STRONG: Indicates stronger emphasis.
HTML 4.01の説明では、emは強調を表し、strongはより強い強調を表す.両者の視覚様式の特徴から言えば、このような「程度上」の解釈は確かに理にかなっている.
しかし、両者を大きな段落、文章の中に置くと、読者が最初に気づいたのは太字のstrongであり、斜体が太くないemを最初に見つけるのは難しいため、読者がどこかを読むと、strongのような内容を見ないがすぐに重要な語句を強調するよりも、emは局所的に強調することに偏っていることが多い.strongはグローバル強調である.
したがって,両者から強調される程度の強弱だけではその違いを説明するのに十分ではない.
意味
HTML 5では、両者の違いをさらに規定している.
The em element represents stress emphasis of its contents. The strong element represents strong importance, seriousness, or urgency for its contents.
MDNでも両者を比較し,Emphasis vs.Strong:
While in HTML4, Strong simply indicated a stronger emphasis, in HTML5, the element is described as representing "strong importance for its contents."This is an important distinction to make. While Emphasis is used to change the meaning of a sentence ("I love carrots"vs. "I love carrots"), Strong is used to give portions of a sentence added importance (e.g., "Warning! This is very dangerous.") Both Strong and Emphasis can be nested to increase the relative degree of importance or stress emphasis, respectively.
EmとstrongではHTML 4で強調の度合いから簡単に区別することはできません.
  • emは内容の着目点(stress emphasis)を表し、置かれた位置が文の意味を変える.
  • strongは内容の重要性(strong importance)を表し、文の重要性を強調し、その文の意味を変えることはありません.


  • 注:次の例では、斜体はem、太字はstrongです.
    Cats are cute animals. 猫を強調して、どの動物が賢くてかわいいかを議論します.
    Cats are cute animals. 強調するのは、猫がかわいいかどうかです.
    Cats are cute animals. 可愛さを強調し、猫が可愛いのか、可愛くないのかを議論します.
    "Warning! This is very dangerous". strongは重要性の強調を表し、文の意味の変化を引き起こさない.

    Warning. This dungeon is dangerous. Avoid the ducks. Take any gold you find. Do not take any of the diamonds, they are explosive and will destroy anything within ten meters. You have been warned.


    注意:emとstrongは、その程度を向上させるためにネストできます.
    リファレンス
  • W3C: Text
  • HTML Living Standard: The strong element
  • MDN:
  • stackoverflow: vs ?
  • ブルー理想:emとstrongの違い
  • Emphasis in context versus overall highlighting