2014-05-12 11 views
0

(請告訴我,如果我要重視這個問題到另一個網站,因爲它的理論。)對於HTML5中的「只是文本」使用p標記是否有很好的理由?

考慮通常

<article class="faux-news"> 
    <h1>The zombies have arisen</h1> 
    <p>Join our reporter as he unravels today's events from Reseda's Northridge Mall this morning.</p> 
    <h2>Oh, the humanity!</h2> 
    <p>Droves of humanity (living and undead) piled up on either side of the glass doors, one drove from the inside trying to get their filthy hands on some brainz and the other drove trying to get their meticulously manicured hands on the new iBerry. To the living, it was just another crowd to fight for their long since pre-loved tech gadget.</p> 
    <h2>Un-undead Victorious</h2> 
    <p>So strong were their desire for the mythical iBerry 6, so firm their resolve, that the living easily overcame the re-living. The stampede was too much for the undead, who were simply left for - dead.</p> 
    <p>And so the living were spared infection by Zombie Rot on this day. But naturally, rumors are already in circulation about, primarily, the iBerry 7, and secondarily, iBerry 6 fans being zombies to begin with and how there's this big conspiracy bankrolled by the liberals and ancient aliens from Alpha Beta Six.</p> 
</article> 

<article class="faux-news"> 
    <h1>The zombies have arisen</h1> 
    Join our reporter as he unravels today's events from Reseda's Northridge Mall this morning. 
    <h2>Oh, the humanity!</h2> 
    Droves of humanity (living and undead) piled up on either side of the glass doors, one drove from the inside trying to get their filthy hands on some brainz and the other drove trying to get their meticulously manicured hands on the new iBerry. To the living, it was just another crowd to fight for their long since pre-loved tech gadget. 
    <h2>Un-undead Victorious</h2> 
    So strong were their desire for the mythical iBerry 6, so firm their resolve, that the living easily overcame the re-living. The stampede was too much for the undead, who were simply left for - dead.<br> 
    And so the living were spared infection by Zombie Rot on this day. But naturally, rumors are already in circulation about, primarily, the iBerry 7, and secondarily, iBerry 6 fans being zombies to begin with and how there's this big conspiracy bankrolled by the liberals and ancient aliens from Alpha Beta Six. 
</article> 

,如果有的話,是的搜索引擎優化懲罰不是將主要文本分成​​幾段(而不是一些標籤作爲分隔符)?

<br>可能有造型問題,但它可以替換爲<span class="br">或任何樣式標籤。

可能存在針對單個段落的樣式問題,但這也可以解決 - f.ex.爲<p class="i-am-individual">只爲那些。

是否還有其他問題需要考慮 - 例如與跨瀏覽器渲染相關的問題?我沒有看到它,但你可能會看到我沒有看到的。

總之什麼是跳過那個討厭的段落文本定義,可能會導致工作的實際金額來解決未閉合<p>標籤與「富文本編輯器的用戶使用」的危險?

+1

OK..try並選擇剛剛文字的每個項目,並添加底利潤的能力,這個蘇答案。有一個! –

+0

在這個問題中,我解決了造型問題,解釋瞭如何製作一個工作示例。你不認爲我會有嗎? http://dl.dropboxusercontent.com/s/yq39772wyflra5r/NoP.png –

回答

1

的「危害」是,你可以有一切「只是文字」不一致的造型,因爲你在繼承造型依託地方出現「只是文字」,它可能出現在封閉比<article>其他HTML標籤。

但是,在您的特殊情況下,這可能完全可以接受。 另外,通過消除無關標記並從必須完成所有必要工作中找到並附上<p>標籤中的「正文」,您將獲得一點點收穫。

個人?我喜歡有包裝

文本再有就是,如果你要使用jQuery to wrap all unwrapped text in p tags

相關問題