課程
/前端開發(fā)
/HTML/CSS
/分頁頁碼制作
怎么實(shí)現(xiàn)動(dòng)態(tài)切換昵,中間省略號(hào)的頁碼怎么表示出來
2017-09-14
源自:分頁頁碼制作 4-2
正在回答
^-^ 通過添加":hover"實(shí)現(xiàn)動(dòng)態(tài)變化;通過省略號(hào)所在的元素標(biāo)簽制作css來表示。
例一:page-icon a:hover{
text-decoration:none;
color:#005aa0;
}
例二:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>分頁頁碼--省略號(hào)不見的問題</title>
<style type="text/css">
.page-icon{
? ? margin:20px 0 0 0;
? ? font-size:0;/*修復(fù)行內(nèi)元素之間空隙間隔*/
? ? text-align:center;
.page-icon a,.page-disabled,page-next{
? ? border:1px solid #ccc;
border-radius:3px;
padding:4px 10px 5px;
font-size:14PX;/*修復(fù)行內(nèi)元素之間空隙間隔*/
margin-right:10px;
.page-icon a{
.page-current{
color:#ff6600;
.page-disabled{
color:#ccc; ??
.ellipsis{
? ?color:#ff6600;
</style>
</head>
<body>
<div class="page-icon">
<span class="page-disabled">上一頁</span>
? ? <span class="page-current">1</span>
? ? <a href="#">2</a>
? ? <a href="#">3</a>
? ? <a href="#">4</a>
? ? <a href="#">5</a>
? ? <a href="#">6</a>
? ? <a href="#">7</a>
? ? <span class="ellipsis">...</span>
? ? <a href="#">199</a>
? ? <a href="#">200</a>
? ? <a class="page-next" href="#">下一頁</a>
</div>
</body>
^-^
有無上涯 提問者
舉報(bào)
制作出具有高大尚樣式的分頁頁碼,學(xué)習(xí)到更多技術(shù)知識(shí)
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2017-09-16
^-^ 通過添加":hover"實(shí)現(xiàn)動(dòng)態(tài)變化;通過省略號(hào)所在的元素標(biāo)簽制作css來表示。
例一:page-icon a:hover{
text-decoration:none;
color:#005aa0;
}
例二:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>分頁頁碼--省略號(hào)不見的問題</title>
<style type="text/css">
.page-icon{
? ? margin:20px 0 0 0;
? ? font-size:0;/*修復(fù)行內(nèi)元素之間空隙間隔*/
? ? text-align:center;
}
.page-icon a,.page-disabled,page-next{
? ? border:1px solid #ccc;
border-radius:3px;
padding:4px 10px 5px;
font-size:14PX;/*修復(fù)行內(nèi)元素之間空隙間隔*/
margin-right:10px;
}
.page-icon a{
text-decoration:none;
color:#005aa0;
}
.page-current{
color:#ff6600;
padding:4px 10px 5px;
font-size:14PX;/*修復(fù)行內(nèi)元素之間空隙間隔*/
}
.page-disabled{
color:#ccc; ??
}
.ellipsis{
? ?color:#ff6600;
}
</style>
</head>
<body>
<div class="page-icon">
<span class="page-disabled">上一頁</span>
? ? <span class="page-current">1</span>
? ? <a href="#">2</a>
? ? <a href="#">3</a>
? ? <a href="#">4</a>
? ? <a href="#">5</a>
? ? <a href="#">6</a>
? ? <a href="#">7</a>
? ? <span class="ellipsis">...</span>
? ? <a href="#">199</a>
? ? <a href="#">200</a>
? ? <a class="page-next" href="#">下一頁</a>
</div>
</body>
^-^