目录 搜索
Attributes accesskey (attribute) class (attribute) contenteditable (attribute) contextmenu (attribute) data-* (attribute) dir (attribute) draggable (attribute) dropzone (attribute) Global attributes hidden (attribute) id (attribute) itemid (attribute) itemprop (attribute) itemref (attribute) itemscope (attribute) itemtype (attribute) lang (attribute) slot (attribute) spellcheck (attribute) style (attribute) tabindex (attribute) title (attribute) translate (attribute) Elements a abbr address area article aside audio b base bdi bdo blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 head header hr html i iframe img input input type="button" input type="checkbox" input type="color" input type="date" input type="datetime"-local input type="email" input type="file" input type="hidden" input type="image" input type="month" input type="number" input type="password" input type="radio" input type="range" input type="reset" input type="search" input type="submit" input type="tel" input type="text" input type="time" input type="url" input type="week" ins kbd label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt rtc ruby s samp script section select slot small source span strong style sub summary sup table tbody td template textarea tfoot th thead time title tr track u ul var video wbr Miscellaneous Attributes Block-level elements CORS enabled image CORS settings attributes Element Inline elements Kinds of HTML content Link types Microdata Optimizing your pages for speculative parsing Preloading content Reference Supported media formats Using the application cache Obsolete acronym applet basefont big blink center command content dir element font frame frameset hgroup image input type="datetime" isindex keygen listing marquee nextid noframes plaintext strike tt xmp
文字

HTML 着重元素 (<em>) 标记出需要用户着重阅读的内容, <em> 元素是可以嵌套的,嵌套层次越深,则其包含的内容被认定为越需要着重阅读。

内容类别

流量内容,措辞内容,可触及的内容

允许的内容

短语内容。

标记遗漏

没有,起始和结束标签都是强制性的。

允许的父母

任何接受短语内容的元素。

允许ARIA角色

任何

DOM界面

HTMLElement包括Gecko 1.9.2(Firefox 4),Firefox实现这个元素的HTMLSpanElement接口。

属性

此元素只包括全局属性。

使用说明

通常这个元素以斜体显示。但是,不应该简单地使用斜体; 使用<cite>元素标记作品的标题(书籍,播放,歌曲等)应该使用此CSS元素; 它典型地用斜体字,但带有不同的含义。使用<strong>元素标记比周围文本更重要的文本。

示例

<em> 元素通常被用于指示一个隐式或显式的对比。

<p>
  In HTML 5, what was previously called  <em>block-level</em> content is now called  <em>flow</em> content.</p>

结果

在HTML 5, 过去被称为块级内容(block-level)的现在被称为流( flow)内容.

<i> vs. <em>

新的开发人员经常被它混淆,为什么有这么多的元素来表达对一些文本的强调。<i> 和 <em> 也许是最常见的一种。 为什么使用 <em></em>vs<i></i>? 他们产生的结果是完全相同的,不是吗?

不完全是. 在 默认情况下,视觉效果是一样的- 这两个标签都把内容呈现为斜体. 但语义是不同的。<em>标签表示着重强调其内容,而 <i> 标签表示从正常的散文中区分出的文本, 如电影或书籍的名字,一个外来词, 或者当文本指的是一个字的定义,而不是其自身代表的语义。

例如,<em>可能是: "Justdoit already!", 或: "Wehadto do something about it". 人或软件在阅读文本时会对斜体字的发音使用重读强调。

例如, <i> 可能是: "The Queen Mary sailed last night". 在这里,没有必要对这个词"Queen Mary"添加强调或重要性. 它只是表明,谈论问题的对象不是一个名叫玛丽女王, 而是一艘名字叫玛丽的船. 另一个例子 <i> 可能是: "The word the is an article".

规范

规范

状态

评论

HTML Living Standard该规范中'<em>'的定义。

生活水平


HTML5该规范中'<em>'的定义。

建议


HTML 4.01规范该规范中'<em>'的定义。

建议


浏览器兼容性

Feature

Chrome

Edge

Firefox

Internet Explorer

Opera

Safari

Basic Support

1

(Yes)

1

(Yes)

(Yes)

(Yes)

Feature

Android

Chrome for Android

Edge mobile

Firefox for Android

IE mobile

Opera Android

iOS Safari

Basic Support

(Yes)

(Yes)

(Yes)

1

(Yes)

(Yes)

(Yes)

上一篇: 下一篇: