2013-03-16 91 views
0

我使用Twitter Bootstrap 2.0.1。我有這樣一個按鈕:在HTML頁面內添加popover數據內容,Twitter引導

<a class="btn btn-info" rel="popover" 
    title="today 12:11" 
    data-content="I'm the content of the button 1 heyoo">Last text</a> 
<a class="btn btn-info" rel="popover" 
    title="yesterday 10:20" 
    data-content="I'm the content of the button 2 heyoo">Last text</a> 

但是,當我使用此代碼時,搜索引擎不考慮「數據內容」。但是我想讓蜘蛛看到「數據內容」。

如果我做這個,按鈕變成大:

<a class="btn btn-info" rel="popover" 
    title="today 12:11">I'm the content of the button 1 heyoo</a> 

這也是可供選擇,而造成重複數據:

<a class="btn btn-info" rel="popover" 
    title="today 12:11" 
    data-content="I'm the content of the button 1 heyoo"> 
    Last text 
<div style="display: none;"> 
<span>I'm the content of the button 1 heyoo</span> 
</div> 
</a> 

另一種方法是把「數據內容」到頁面,但用字體1點寫它。但我認爲這不是一個好主意。

回答

0

但是,當我使用此代碼時,搜索引擎不考慮「數據內容」。

他們爲什麼要這樣做?

當我搜索到的按鈕1 heyoo「」的內容文本沒有以可讀的方式顯示給我時,什麼是將搜索引擎引導到您的網站的好處那個頁面?

+0

如果將鼠標懸停在按鈕上,則可以閱讀該內容。這就是popover按鈕的工作原理。 – trante 2013-03-19 17:25:30

+0

然後它是相關的信息,並且應該在適當的HTML元素 - 不只是在某些屬性,我不會看到如果f.e.我訪問JS和/或CSS停用的頁面。而對於沒有懸停功能的移動設備,無論如何,您最可能需要對此內容進行不同的呈現。 – CBroe 2013-03-20 08:58:11