淺析HTML標(biāo)簽strong和em的區(qū)別_XHTML教程
教程Tag:暫無(wú)Tag,歡迎添加,賺取U幣!
淺析HTML標(biāo)簽strong和em的區(qū)別,可以從三個(gè)層次上來(lái)談。
首先看 HTML 4.01 中的說(shuō)明:
EM: Indicates emphasis.
STRONG: Indicates stronger emphasis.
em 表示強(qiáng)調(diào),strong 表示更強(qiáng)烈的強(qiáng)調(diào)。言簡(jiǎn)意賅,表明了 em 和 strong 的命名來(lái)歷。并且在瀏覽器中,em 默認(rèn)用斜體表示,strong 用粗體表示。這是第一個(gè)層次上的區(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 用來(lái)局部強(qiáng)調(diào),strong 則是全局強(qiáng)調(diào)。從視覺上考慮,em 的強(qiáng)調(diào)是有順序的,閱讀到某處時(shí),才會(huì)注意到。strong 的強(qiáng)調(diào)則是一種隨意無(wú)順序的,看見某文時(shí),立刻就凸顯出來(lái)的關(guān)鍵詞句。斜體和粗體剛好滿足了這兩種視覺效果,因此也就成了 em 和 strong 的默認(rèn)樣式。
感覺上面已經(jīng)解釋得很清楚了?我們?cè)賮?lái)看看第三個(gè)層次上的區(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)容的著重點(diǎn)(stress emphasis),strong 表示內(nèi)容的重要性(strong importance),strong 不會(huì)改變所在句子的語(yǔ)意,em 則會(huì)改變所在句子的語(yǔ)義。并且舉了一個(gè)非常好的例子:
強(qiáng)調(diào)貓,討論的是哪種動(dòng)物聰明可愛。
強(qiáng)調(diào)是,討論的是貓是不是聰明可愛。
強(qiáng)調(diào)聰明可愛,討論的是貓究竟是聰明可愛呢還是愚蠢討厭。
strong 表示的是重要性上的強(qiáng)調(diào),不會(huì)引起句子意思的變化。最后注意 em 和 strong 都可以有多重,比如可以用兩個(gè) strong 來(lái)表示內(nèi)容很重要。
可以看出,第二個(gè)層次上所說(shuō)的局部強(qiáng)調(diào)和全局強(qiáng)調(diào)是不夠準(zhǔn)確的。em 和 strong 區(qū)別的玄妙處,在 HTML5 草案里才得到淋漓盡致的闡釋。推薦大家有時(shí)間的時(shí)候,仔細(xì)閱讀 HTML5 草案。有很多元素的語(yǔ)義,都闡釋得非常清楚,對(duì)于我們?nèi)绾卧谧钋‘?dāng)?shù)牡胤绞褂米钋‘?dāng)?shù)臉?biāo)簽,非常具有價(jià)值。
em 是句意強(qiáng)調(diào),加與不加會(huì)引起語(yǔ)義變化。
strong 是重要性強(qiáng)調(diào),和局部還是全局無(wú)關(guān),局部強(qiáng)調(diào)用strong也可以,strong強(qiáng)調(diào)的是重要性,不會(huì)改變句意。
首先看 HTML 4.01 中的說(shuō)明:
EM: Indicates emphasis.
STRONG: Indicates stronger emphasis.
em 表示強(qiáng)調(diào),strong 表示更強(qiáng)烈的強(qiáng)調(diào)。言簡(jiǎn)意賅,表明了 em 和 strong 的命名來(lái)歷。并且在瀏覽器中,em 默認(rèn)用斜體表示,strong 用粗體表示。這是第一個(gè)層次上的區(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 用來(lái)局部強(qiáng)調(diào),strong 則是全局強(qiáng)調(diào)。從視覺上考慮,em 的強(qiáng)調(diào)是有順序的,閱讀到某處時(shí),才會(huì)注意到。strong 的強(qiáng)調(diào)則是一種隨意無(wú)順序的,看見某文時(shí),立刻就凸顯出來(lái)的關(guān)鍵詞句。斜體和粗體剛好滿足了這兩種視覺效果,因此也就成了 em 和 strong 的默認(rèn)樣式。
感覺上面已經(jīng)解釋得很清楚了?我們?cè)賮?lái)看看第三個(gè)層次上的區(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)容的著重點(diǎn)(stress emphasis),strong 表示內(nèi)容的重要性(strong importance),strong 不會(huì)改變所在句子的語(yǔ)意,em 則會(huì)改變所在句子的語(yǔ)義。并且舉了一個(gè)非常好的例子:
示例代碼 [hl5o.cn]
<p><em>Cats</em> are cute animals.</p>
強(qiáng)調(diào)貓,討論的是哪種動(dòng)物聰明可愛。
示例代碼 [hl5o.cn]
<p>Cats <em>are</em> cute animals.</p>
強(qiáng)調(diào)是,討論的是貓是不是聰明可愛。
示例代碼 [hl5o.cn]
<p>Cats are <em>cute</em> animals.</p>
強(qiáng)調(diào)聰明可愛,討論的是貓究竟是聰明可愛呢還是愚蠢討厭。
示例代碼 [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>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 表示的是重要性上的強(qiáng)調(diào),不會(huì)引起句子意思的變化。最后注意 em 和 strong 都可以有多重,比如可以用兩個(gè) strong 來(lái)表示內(nèi)容很重要。
可以看出,第二個(gè)層次上所說(shuō)的局部強(qiáng)調(diào)和全局強(qiáng)調(diào)是不夠準(zhǔn)確的。em 和 strong 區(qū)別的玄妙處,在 HTML5 草案里才得到淋漓盡致的闡釋。推薦大家有時(shí)間的時(shí)候,仔細(xì)閱讀 HTML5 草案。有很多元素的語(yǔ)義,都闡釋得非常清楚,對(duì)于我們?nèi)绾卧谧钋‘?dāng)?shù)牡胤绞褂米钋‘?dāng)?shù)臉?biāo)簽,非常具有價(jià)值。
em 是句意強(qiáng)調(diào),加與不加會(huì)引起語(yǔ)義變化。
strong 是重要性強(qiáng)調(diào),和局部還是全局無(wú)關(guān),局部強(qiáng)調(diào)用strong也可以,strong強(qiáng)調(diào)的是重要性,不會(huì)改變句意。
相關(guān)XHTML教程:
- HTML5 INPUT placeholder及兼容性處理
- HTML表單里的Label標(biāo)簽
- 淺析HTML與javascript中常用編碼
- CSS網(wǎng)頁(yè)布局中必須要了解的幾個(gè)XHTML標(biāo)簽
- title和alt 標(biāo)簽介紹及其異同
- 說(shuō)說(shuō)XHTML中的alt屬性和title屬性
- Semantics語(yǔ)義是Html Xhtml是否真正符合標(biāo)準(zhǔn)的重要部分
- 九個(gè)W3C XHTML1.0及CSS標(biāo)準(zhǔn)認(rèn)證需要注意的問題
- 請(qǐng)注意頁(yè)面head區(qū)域的編碼是不是規(guī)范
- HTML validate - 驗(yàn)證HTML代碼穿越多重瀏覽器標(biāo)準(zhǔn)
- XHTML具有語(yǔ)義的標(biāo)簽:有關(guān)H1位置的討論
- HTML結(jié)構(gòu)更加清晰、規(guī)范,學(xué)習(xí)HTML5優(yōu)化結(jié)構(gòu)的思路。
XHTML教程Rss訂閱Div+Css教程搜索
XHTML教程推薦
- HTML表格標(biāo)記教程(39):表頭的亮邊框色屬性BORDERCOLORLIGHT
- HTML5ElementsandAttributes-HTML5元素和屬性
- HTML表格標(biāo)記教程(43):表頭的垂直對(duì)齊屬性VALIGN
- HTML高級(jí)教程 聲明
- HTML表格標(biāo)記教程(10):單元格邊距屬性CELLPADDING
- DIVCSS網(wǎng)頁(yè)布局中常用的列表元素ulollidldtdd釋義
- HTML表格標(biāo)記教程(25):行的垂直對(duì)齊屬性VALIGN
- HTML表單里的Label標(biāo)簽
- 總結(jié)XHTML代碼常見的應(yīng)用問題
- HTML中級(jí)教程不良標(biāo)簽
- 相關(guān)鏈接:
- 教程說(shuō)明:
XHTML教程-淺析HTML標(biāo)簽strong和em的區(qū)別
。