DIV CSS 佈局教程網

您现在的位置: DIV+CSS佈局教程網 >> 網頁腳本 >  >> HTML基礎知識 >> HTML5教程
HTML5 中 b 與 i 標籤的語義化轉變
編輯:HTML5教程     

在以往的 Web 標準潛規則裡,b 與 i 標籤是不被推薦、甚至被反對使用的,因為大家認為它們只是「表現」粗體與斜體,本身不具備任何「語義」,因此更提倡改用 strong 與 em 來代替。

然而,在新的 HTML5 工作草案中,b 與 i 標籤卻被賦予了明確的語義定義。從規範中可以注意到:b 與 i 元素將被賦予真正的語義,我們更應具備預見性地留意 b、i 與 strong、em 在使用場合上的差異。

以下引述 A Preview of HTML 5 中的官方定義並加以說明:

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 元素現在代表的是一段以不同語氣或情緒呈現、或與正文有所區隔的文本,例如分類學名稱、技術術語、外語中的慣用語、一段內心想法等,或其他慣例上以斜體呈現的文本。其使用方式會因語言而異。

換句話說,HTML5 為這兩個「老」標籤注入了新生命:它們不再只是外觀工具,而是承載著明確語義的語意標記,選用時應回歸到內容意圖本身。

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved