日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

淺析HTML標(biāo)簽strong和em的區(qū)別_XHTML教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!
  淺析HTML標(biāo)簽strong和em的區(qū)別,可以從三個層次上來談。

  首先看 HTML 4.01 中的說明:
  EM: Indicates emphasis.
  STRONG: Indicates stronger emphasis.

  em 表示強調(diào),strong 表示更強烈的強調(diào)。言簡意賅,表明了 em 和 strong 的命名來歷。并且在瀏覽器中,em 默認(rèn)用斜體表示,strong 用粗體表示。這是第一個層次上的區(qū)別。
  em is for local emphasis. You see? Local emphasis. If you would emphasize a word in speech, use em.
strong is for global highlighting. When somebody looks at your document, at a glance, certain words and phrases should jump out. These are the words and phrases that make up the gist of the content — the highlights.
  em 用來局部強調(diào),strong 則是全局強調(diào)。從視覺上考慮,em 的強調(diào)是有順序的,閱讀到某處時,才會注意到。strong 的強調(diào)則是一種隨意無順序的,看見某文時,立刻就凸顯出來的關(guān)鍵詞句。斜體和粗體剛好滿足了這兩種視覺效果,因此也就成了 em 和 strong 的默認(rèn)樣式。
  感覺上面已經(jīng)解釋得很清楚了?我們再來看看第三個層次上的區(qū)別。HTML5 草案 中做了詳盡解釋:
  The em element represents stress emphasis of its contents. The placement of emphasis changes the meaning of the sentence.
  The strong element represents strong importance for its contents. Changing the importance of a piece of text with the strong element does not change the meaning of the sentence.
  em 表示內(nèi)容的著重點(stress emphasis),strong 表示內(nèi)容的重要性(strong importance),strong 不會改變所在句子的語意,em 則會改變所在句子的語義。并且舉了一個非常好的例子:

示例代碼 [www.hl5o.cn]
<p><em>Cats</em> are cute animals.</p>

  強調(diào)貓,討論的是哪種動物聰明可愛。

示例代碼 [www.hl5o.cn]
<p>Cats <em>are</em> cute animals.</p>

  強調(diào)是,討論的是貓是不是聰明可愛。

示例代碼 [www.hl5o.cn]
<p>Cats are <em>cute</em> animals.</p>

  強調(diào)聰明可愛,討論的是貓究竟是聰明可愛呢還是愚蠢討厭。

示例代碼 [www.hl5o.cn]
<p><strong>Warning.</strong> This dungeon is dangerous.
<strong>Avoid the ducks.</strong> Take any gold you find.
<strong><strong>Do not take any of the diamonds</strong>,
they are explosive and <strong>will destroy anything within
ten meters.</strong></strong> You have been warned.</p>

  strong 表示的是重要性上的強調(diào),不會引起句子意思的變化。最后注意 em 和 strong 都可以有多重,比如可以用兩個 strong 來表示內(nèi)容很重要。
  可以看出,第二個層次上所說的局部強調(diào)和全局強調(diào)是不夠準(zhǔn)確的。em 和 strong 區(qū)別的玄妙處,在 HTML5 草案里才得到淋漓盡致的闡釋。推薦大家有時間的時候,仔細(xì)閱讀 HTML5 草案。有很多元素的語義,都闡釋得非常清楚,對于我們?nèi)绾卧谧钋‘?dāng)?shù)牡胤绞褂米钋‘?dāng)?shù)臉?biāo)簽,非常具有價值。
  em 是句意強調(diào),加與不加會引起語義變化。
  strong 是重要性強調(diào),和局部還是全局無關(guān),局部強調(diào)用strong也可以,strong強調(diào)的是重要性,不會改變句意。
  
  

來源:52CSS//所屬分類:XHTML教程/更新時間:2012-06-10
相關(guān)XHTML教程