如果您的網(wǎng)站上有很多頁面,則可能需要使用某種分頁。
要?jiǎng)?chuàng)建基本分頁,請(qǐng)使用欄(w3-bar)中的按鈕(w3-button)。
<div class="w3-bar">
<a href="#" class="w3-button">1</a>
<a href="#" class="w3-button">2</a>
<a href="#" class="w3-button">3</a>
<a href="#" class="w3-button">4</a>
<a href="#" class="w3-button">5</a>
</div>
要?jiǎng)h除按鈕之間的空格,請(qǐng)?zhí)砑?nbsp;w3-bar-item 類:
<div class="w3-bar">
<a href="#" class="w3-bar-item w3-button">1</a>
<a href="#" class="w3-bar-item w3-button">2</a>
<a href="#" class="w3-bar-item w3-button">3</a>
<a href="#" class="w3-bar-item w3-button">4</a>
<a href="#" class="w3-bar-item w3-button">5</a>
</div>
使用圖標(biāo)庫中的HTML實(shí)體或圖標(biāo)添加分頁箭頭:
<div class="w3-bar">
<a href="#" class="w3-button">?</a>
<a href="#" class="w3-button">1</a>
<a href="#" class="w3-button">2</a>
<a href="#" class="w3-button">3</a>
<a href="#" class="w3-button">4</a>
<a href="#" class="w3-button">5</a>
<a href="#" class="w3-button">?</a>
</div>
使用 w3-color 類別之一來指示用戶所在的頁面:
<div class="w3-bar">
<a href="#" class="w3-button">?</a>
<a href="#" class="w3-button w3-green">1</a>
<a href="#" class="w3-button">2</a>
<a href="#" class="w3-button">3</a>
<a href="#" class="w3-button">4</a>
<a href="#" class="w3-button">?</a>
</div>
默認(rèn)情況下,將鼠標(biāo)移到分頁鏈接上時(shí),它們將變?yōu)榛疑尘吧?。使用任?strong>w3-hover- color類來更改懸停顏色:
<div class="w3-bar">
<a href="#" class="w3-button w3-hover-purple">?</a>
<a href="#" class="w3-button w3-hover-green">1</a>
<a href="#" class="w3-button w3-hover-red">2</a>
<a href="#" class="w3-button w3-hover-blue">3</a>
<a href="#" class="w3-button w3-hover-black">4</a>
<a href="#" class="w3-button w3-hover-orange">?</a>
</div>
使用w3-tiny,w3-small,w3-large,w3-xlarge,w3-xxlarge或 w3-xxxlarge來設(shè)置分頁大?。?/p>
要使分頁居中,請(qǐng)將“ w3-bar”元素放在“ w3-center”元素內(nèi):
<div class="w3-center">
<div class="w3-bar">
<a href="#" class="w3-bar-item w3-button">?</a>
<a href="#" class="w3-button">1</a>
<a href="#" class="w3-button">2</a>
<a href="#" class="w3-button">3</a>
<a href="#" class="w3-button">4</a>
<a href="#" class="w3-button">?</a>
</div>
</div>
添加 w3-border 類以創(chuàng)建帶有邊框的分頁:
在 w3-border 旁邊添加 w3-round 類以獲取圓角邊框:
w3-bar 類還可用于創(chuàng)建下一頁/上一頁按鈕:
w3-bar 類也可以用于創(chuàng)建嵌入式菜單:
更多建議: