HTML 5 <i> 标签

定义和用法

<i> 标签呈现斜体的文本。

<i> 标签定义与文本中其余部分不同的部分,并把这部分文本呈现为斜体文本。在没有其他元素可以使用时,比如 <b>, <cite>, <dfn>, <em>, <q>, <small>, <strong>,请使用 <i> 标签。

HTML 4.01 与 HTML 5 之间的差异

没有区别。

但是在 HTML 4.01 中,存在着一种理解,即应该使用 CSS 来制作斜体文本。在 HTML 5 中,情况没有改变,但是你应该使用 <i> 标签把部分文本定义为某种类型,而不只是利用它在布局中所呈现的样式。

例子

<p>The <i class="taxonomy">Felis silvestris catus</i> is cute.</p>
<p>The term <i>prose content</i> is defined above.</p>
<p>There is a certain <i lang="fr">je ne sais quoi</i> in the air.</p>

属性

标准属性

class, contenteditable, contextmenu, dir, draggable, id, irrelevant, 
lang, ref, registrationmark, tabindex, template, title

如需完整的描述,请访问 HTML 5 中标准属性

事件属性

onabort, onbeforeunload, onblur, onchange, onclick, oncontextmenu, 
ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, 
ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress, onkeyup, 
onload, onmessage, onmousedown, onmousemove, onmouseover, onmouseout, 
onmouseup, onmousewheel, onresize, onscroll, onselect, onsubmit, onunload

如需完整的描述,请访问 HTML 5 中事件属性