资讯专栏INFORMATION COLUMN

em和strong的区别

GeekQiaQia / 848人阅读

摘要:和的区别,可以从三个层次上来谈。首先看中的说明表示强调,表示更强烈的强调。言简意赅,表明了和的命名来历。并且在浏览器中,默认用斜体表示,用粗体表示。强调事实,讨论的是猫是可爱的动物的事实。这里的使用是为了和其他内容区分开来。

em 和 strong 的区别,可以从三个层次上来谈。

首先看 HTML 4.01 中的说明:

EM: Indicates emphasis.
STRONG: Indicates stronger emphasis.

em 表示强调,strong 表示更强烈的强调。言简意赅,表明了 em 和 strong 的命名来历。并且在浏览器中,em 默认用斜体表示,strong 用粗体表示。这是第一个层次上的区别。

第二个层次上,在 Emphasis in context versus overall highlighting 和 em vs. strong 这两篇文章中,做了很好的总结:

  

em is for local emphasis. You see? Local emphasis. If you would emphasize a word in speech, use em. 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 that make up the gist of the content — the highlights.

em 用来局部强调,strong 则是全局强调。从视觉上考虑,em 的强调是有顺序的,阅读到某处时,才会注意到。strong 的强调则是一种随意无顺序的,看见某文时,立刻就凸显出来的关键词句。斜体和粗体刚好满足了这两种视觉效果,因此也就成了 em 和 strong 的默认样式。

感觉上面已经解释得很清楚了?我们再来看看第三个层次上的区别。HTML5 标准中做了详尽解释:

  

The em element represents stress emphasis of its contents.
The placement of emphasis changes the meaning of the sentence.——em
element

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. (This is distinct from marking up subheadings, for which the hgroup element is appropriate.)

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.——strong element

em 表示内容的重点(stress emphasis),strong 表示强烈的重要性、严重性或内容的紧迫性,strong 不会改变所在句子的语意,em 则会改变所在句子的语义。并且举了一个非常好的例子:

Cats are cute animals.

强调猫,讨论的是哪种动物聪明可爱。

Cats are cute animals.

强调事实,讨论的是猫是可爱的动物的事实。

Cats are cute animals.

强调可爱,讨论的是猫是否可爱。

Chapter 1: The Praxis

"chapter 1"仅仅是个引用,后面strong里的内容才是章节真正的名字。

Figure 1. Ant colony dynamics. The ants in this colony are affected by the heat source (upper left) and the food source (lower right).

Flowers, Bees, and Honey and other things I don"t understand

这里strong的使用是为了和其他内容区分开来。

In this example, the strong element is used to denote the part of the text that the user is intended to read first.
在这个例子里,strong标签是用来指示用户优先查看的部分内容。

Welcome to Remy, the reminder system.

Your tasks for today:

  • Turn off the oven.

  • Put out the trash.

  • Do the laundry.

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/49548.html

相关文章

  • CSS:em strong 区别

    摘要:程度在的说明中,表示强调,表示更强烈的强调。因此,光从二者强调程度上的强弱已经不足以说明其区别。语意在中,进一步规定了两者的区别中也将两者进行了对比,和已经不可以再用中从强调的程度来简单区分差别了。参考蓝色理想和的区别 表现 em vs strong 在浏览器中, 默认用斜体表示, 用粗体表示。从样式表现上, 更加突出,更容易吸引眼光。显然,这种视觉上的差异设计是有目的的。 程度 ...

    zhou_you 评论0 收藏0
  • HTML语义化标签探析

    摘要:具体的语义化标签探析本文主要是为了探析部分标签在语义化中的差别。同时也探索新加入的语义化标签。英文意思为,作用是定义列表中的项目。强调标签说明在上面的介绍中,已经介绍了和,个中差别,看英文既能分辨。 什么是HTML语义化 HTML语义化就是根据具体内容,选择合适的标签进行代码的编写。便于开发者阅读和写出更优雅的代码,同时让搜索引擎的爬虫能更好的识别。 为什么要语义化 有利于SEO:搜...

    DandJ 评论0 收藏0
  • HTML语义化

    摘要:近来看面试题的时候,经常看到一个问题语义化是什么意思里面有标签的含义。因为二者表示的含义不同。参考资料理解语义化语义化的革新语义化标签语义化标签探析 近来看面试题的时候,经常看到一个问题:HTML语义化是什么意思?w3school里面有html标签的含义。然而HTML5中对一些标签进行了修改,由于不了解H5的新定义,就很容易弄错标签之间的意思。例如:既然i标签是指斜体的意思,那么为什么...

    Mike617 评论0 收藏0

发表评论

0条评论

GeekQiaQia

|高级讲师

TA的文章

阅读更多
最新活动
阅读需要支付1元查看
<