您的位置:首页 > Web前端 > HTML5

HTML5 :b/strong加粗,i/em倾斜区别

2016-04-14 13:56 429 查看

解释1

<!DOCTYPE html>
<html  lang="zh-CN">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<i>i倾斜,h4:无意义的斜体,不推荐,h5:分类名称,技术术语,外语中的谚语,想法,无意义的排版</i><br/>
<em>em倾斜,h4:一般强调(倾斜文本)h5:句子中强调</em><br/>
<b>b加粗,h4:无意义的加粗:不推荐,h5:文档概要中的关键字,评论中的产品名,无意义的排版</b><br/>
<strong>strong加粗,h4:更强强调(加粗文本)h5:html页面上强调</strong><br/>
</body>
</html>

截图



在HTML4.01中:

< b > < i > 是
视觉要素(presentationl elements)
,分别表示
无意义的加粗,无意义的斜体
,表现样式为 { font-weight: bolder },仅仅表示「这里应该用粗体显示」或者「这里应该用斜体显示」,此
两个标签在HTML4.01中并不被推荐使用


< em > 和 < strong > 是
表达要素(phrase elements)
。 < em > (emphasized text)表示一般的强调文本,而
< strong > (strong emphasized text)表示比 < em > 语义更强的的强调文本


而在新的 HTML5 工作草案 中:

< em > 和 < strong > 仍旧是
表达要素(phrase elements)
。但这时的 < strong > 表示
html页面上
的强调(emphasized text), < em > 表示
句子中
的强调(即强调语义)

对于 b 和 i 标签是这样定义的:

The b element now represents a span of text to be stylistically offset from the normal prose without conveying any extra importance, such as key words in a document abstract, product names in a review, or other spans of text whose typical typographic presentation is emboldened.

//
b
元素现在描述为在普通文章中仅从文体上突出的不包含任何额外的重要性的一段文本。例如:文档概要中的关键字,评论中的产品名。或者代表强调的排版方式。

The i element now represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose, such as a taxonomic designation, a technical term, an idiomatic phrase from another language, a thought, a ship name, or some other prose whose typical typographic presentation is italicized. Usage varies widely by language.

//
i
元素现在描述为在普通文章中突出不同意见或语气或其他的一段文本,例如:一个分类名称,一个技术术语,一个外语中的谚语,一个想法等。或者代表斜体的排版方式。

从规范中可以注意到:b 和 i 元素将被赋予真正的语义。更应有预见性注意 b 、i 与 strong 、em 的不同使用 。

解释2

b 和 i 标签在现在的 Web 标准潜规则中是不推荐使用,甚至是反对使用的,因为认为他们只是“表现”粗体和斜体,而没有任何“语义”。更多的用 strong 和 em 标签代替。

而在新的 HTML5 工作草案 中对于 b 和 i 标签是这样定义的:

The b element now represents a span of text to be stylistically offset from the normal prose without conveying any extra importance, such as key words in a document abstract, product names in a review, or other spans of text whose typical typographic presentation is emboldened.

// b 元素现在描述为在普通文章中仅从文体上突出的不包含任何额外的重要性的一段文本。例如:文档概要中的关键字,评论中的产品名。或者代表强调的排版方式。

The i element now represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose, such as a taxonomic designation, a technical term, an idiomatic phrase from another language, a thought, a ship name, or some other prose whose typical typographic presentation is italicized. Usage varies widely by language.

// i 元素现在描述为在普通文章中突出不同意见或语气或其他的一段文本,例如:一个分类名称,一个技术术语,一个外语中的谚语,一个想法等。或者代表斜体的排版方式。

从规范中可以注意到:b 和 i 元素将被赋予真正的语义。更应有预见性注意 b 、i 与 strong 、em 的不同使用 。

地址

http://www.zhihu.com/question/19551271

http://www.planabc.net/2008/03/14/html5_b_and_i_tags_read_semantic/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: