標籤:

HTML 元素 <b> 和 <strong> 有什麼區別?

&This text is bold&
&This text is strong&

感覺效果差不多啊。


不要動不動就把英語的術語、名稱或概念牽強地翻譯成中文。
不是「粗體和加重有什麼區別」(原題如此),是「HTML 標籤 & 和 & 有什麼區別」。

HTML 的標籤負責將內容標記為 HTML 元素,瀏覽器的默認 CSS 樣式表負責按照 W3C 的建議來指定 HTML 元素的默認樣式。

在那個用 HTML 指定字體、字型大小、顏色……的時代,HTML 標籤 & 的意思是「bold」(粗體),它是一個單純的樣式標籤,指定文本要用粗體。& 是一個帶有著重意味的標籤,瀏覽器通常也把它顯示為粗體。
後來 CSS 興起,CSS 語句 font-weight: bold 成為首選的設置粗體的手法。& 這種樣式標籤通常被唾棄,而 & 這樣的語義標籤受推崇。
後來 HTML5 興起,重新界定了 & & & & 這幾個相似標籤的意義。直接從 HTML5 規範原文來看,其實很清楚:

  • &:「stress emphasis of its contents」——強調內容。
  • &:「strong importance for its contents」——著重內容。

Emphasis 和 importance 的區別對於漢語使用者來說可能也比較難把握。但如果你熟悉英語的寫作格式,你會明白格式化為斜體的各種強調文本與格式化為粗體的著重文本的區別。英語等西文的正文中,粗體其實是很少出現的。

  • &:「a span of text in an alternate voice or mood, or otherwise offset from the normal prose in a manner indicating a different quality of text, such as a taxonomic designation, a technical term, an idiomatic phrase from another language, transliteration, a thought, or a ship name in Western texts」——無強調或著重意味的斜體(italic),比如生物學名、術語、外來語(比如「de facto」這樣的英語里常用的拉丁語短語)……
  • &:「a span of text to which attention is being drawn for utilitarian purposes without conveying any extra importance and with no implication of an alternate voice or mood, such as key words in a document abstract, product names in a review, actionable words in interactive text-driven software, or an article lede」——無強調或著重意味的粗體(bold),比如文章摘要中的關鍵詞、評測文章中的產品名稱、文章的導言……

所以是的,正常瀏覽器里 & 和 & 都顯示為粗體。
「在網頁顯示中」沒有什麼區別。在代碼編寫上有區別。

如果你懶得看 W3C 文檔,手頭又沒有稱職的教材或參考書,遇到 HTML 元素意義的問題時,直接去看維基百科的這個詞條:HTML element


盲人朋友使用閱讀設備閱讀網路時:&會重讀,&不會


兩者雖然在網頁中顯示效果一樣,但實際目的不同。
&這個標籤對應 bold,即文本加粗,其目的僅僅是為了加粗顯示文本,是一種樣式/風格需求;
&這個標籤意思是加強,表示該文本比較重要,提醒讀者/終端注意。為了達到這個目的,瀏覽器等終端將其加粗顯示;
總結:&為了加粗而加粗,&為了標明重點而加粗。


從網站優化方面分析,最主要的區別應該是& XX&內的內容比起&XX&的內容應該更容易被網路蜘蛛抓取,也就是更容易使網站被用戶搜索到


多年前做的一個東西. http://wiseinfo.mycloudnas.com/wiui/ESTesting.htm 請注意開頭我個人對 HTML 標籤的分類中的兩類. ( 屏蔽 .CN 類中的 "display: none;" 可見中文 )


Physical Style Elements -- 自然樣式標籤
b, i, u, s, pre
Semantic Style Elements -- 語義樣式標籤
strong, em, ins, del, code

所謂 樣式標籤 即為獲得某種字體樣式效果而使用的標籤. 但 自然樣式標籤語義樣式標籤 目的確截然不同. 樣式標籤的發明遠早於 HTML 的發明, 最初 HTML 沿用了 b, i, u, s 等樣式標籤以幫助網頁獲得與傳統紙質文檔相同的字體樣式效果. 但隨著 機器閱讀 的需要, 樣式標籤不但要解決人類閱讀時通過樣式來區分文章中文字的語義, 也同時要解決機器閱讀時通過標籤來區分文章中文字的語義與權重. 樣式與含義並沒有內在聯繫, 粗體並不一定意味著加重, 強調也不一定意味著斜體. 為了各自不同的目的, 產生了自然樣式標籤與語義樣式標籤. 自然樣式標籤 定義樣式. 語義樣式標籤 定義語義與權重.

我使用了 語義樣式標籤 而沒有按常規直接稱為 語義標籤 . 因為為了兼顧機器閱讀和人類閱讀, 每種語義樣式標籤還是有其獨特的樣式. 默認情況下瀏覽器將其與自然樣式標籤一一對應, 但也有 漢字標準格式 這樣的項目重新定義了語義樣式標籤的樣式. 也就是說, 語義樣式標籤不一定對應自然樣式標籤的樣式. strong, em 不一定就是粗體, 斜體. 可以是特別的顏色, 特別的字型大小 ( 據說在光明網 (朝鮮) 中顯示金家三胖兒們的名字時都要大一個字型大小 ) 等等.

至於 自然樣式標籤 因為其無語義性. 除了默認的樣式外, 完全可以通過 CSS 將其變化為各種樣式使用在各個地方. 例如:

按鈕內的 icon . 很多人都會用 && . 但我可能會直接使用 && 然後在 CSS 中用 .button i {} 來定義 ( 這方法有利有弊, 純屬個人選擇 ) . 但如果這裡用 em 標籤就不合適了.

至於如何選擇使用兩種, 我的觀點是 " 準確使用語義樣式標籤, 但不能濫用, 如果不能確定時首選使用自然樣式標籤. 文章內 ( article, p 標籤內 ) 使用語義樣式標籤, 排版 ( div 標籤內 ) 內使用自然樣式標籤"

---------- ---------- ---------- ---------- --

保留答案. 但上述某些觀點已經過於陳舊. 更多關於本答案的是非請參閱 評論


They have the same effect on normal web browser rendering engines, but there is afundamental difference between them.

As the author writes in a discussion list post:

Think of three different situations:

  • web browsers
  • blind people
  • mobile phones

"Bold" is a style - when you say "bold a word", people basically know that it means to add more, let"s say "ink", around the letters until they stand out more amongst the rest of the letters.

That, unfortunately, means nothing to a blind person. On mobile phones and other PDAs, text is already bold because screen resolution is very small. You can"t bold a bold without screwing something up.

& is a style - we know what "bold" is supposed to look like.

& however is an indication of how something should be understood. "Strong" could (and often does) mean "bold" in a browser, but it could also mean a lower tone for a speaking program like Jaws (for blind people) or be represented by an underline (since you can"t bold a bold) on a Palm Pilot.

HTML was never meant to be about styles. Do some searches for "Tim Berners-Lee" and "the semantic web." & is semantic—it describes the text it surrounds (e.g., "this text should be stronger than the rest of the text you"ve displayed") as opposed to describing how the text it surrounds should be displayed (e.g., "this text should be bold").


來自:http://stackoverflow.com/questions/271743/whats-the-difference-between-b-and-strong-i-and-em


推薦閱讀:

PDF 中文文檔在 XP 下顯示正常,在 Windows 7 下顯示亂碼、生僻字元,如何處理?
寫英語時有沒有必要將t i 等字母的一橫和點最後在寫?
刻章收藏 刻什麼字合適?
這些手指寫出來的字是否稱得上是書法?寫字的人算是什麼水平?
設計師都覺得宋體很難看嗎?

TAG:字體 | HTML |