DIV CSS 佈局教程網

您现在的位置: DIV+CSS佈局教程網 >> 網頁腳本 >  >> HTML基礎知識 >> HTML和Xhtml
HTML5 為 b 與 i 標籤賦予真正的語意
編輯:HTML和Xhtml     

在現行的 Web 標準潛規則中,b 與 i 並不建議使用,甚至有反對的聲音——理由在於它們只表達「粗體」與「斜體」的樣式,缺乏任何語意,因此應以 strong 與 em 取代。

然而在新的 HTML5 工作草案中,這兩個標籤的定義出現了根本性的轉變。

草案中的定義

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.

相對地,i 描述的是一段語氣或聲調不同、或與正文有所區隔的文字。例如生物分類學名稱、技術術語、外語的慣用語、內心的想法、船艦名稱等等,其使用習慣會因語言而異。

從規範中可以清楚看到:b 與 i 確實被賦予了真正的語意。因此在實際專案裡,更應該有預見性地留意它們與 strong、em 之間的差異——前者標示的是「文體上的區隔」,後者傳達的是「重要性」與「語氣上的強調」。選錯標籤,螢幕閱讀器唸出來的東西也就跟著變了。

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