課程
/前端開發
/HTML/CSS
/企業網站綜合布局實戰
當前的頁碼,對應的是<a>標簽link,visted,hover,active的哪種狀態?
我給hover和active都設置了紅色的背景,這樣做就可以了嗎?
2017-07-31
源自:企業網站綜合布局實戰 4-7
正在回答
a:focus
{
? ?background-color:red;
}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>頁碼的制作</title>
<style>
/*在此定義相關CSS樣式*/
.page a{
? ? border:1px solid #e8e8e8;
? ? background-color:#fff;
? ? padding:5px 10px;
? ? margin:5px;
.page a:hover,.page a:active
? ? background:#c00;
</style>
</head>
<body>
<!--在此制作頁碼的基本結構-->
<div class="page">
? ? <a herf="#">首頁</a><a herf="#"><</a><a herf="#">1</a><a herf="#">2</a><a herf="#">3</a><a herf="#">...</a>
? ? <a herf="#">></a><a herf="#">末頁</a>
</div>
</body>
</html>
我覺得是a:hover跟a:visited設為紅色?
先給比如第一頁設置一個名為class的類。定義這個類的樣式為background-color:red,就可以把第一頁設置為當前頁,具體的當前頁是哪一頁的點擊事件需要用javascript去設置
a:link {color: #FF0000} /* 未訪問的鏈接 */
a:visited {color: #00FF00} /* 已訪問的鏈接 */
a:hover {color: #FF00FF} /* 鼠標移動到鏈接上 */
a:active {color: #0000FF} /* 選定的鏈接 */
舉報
本課程重點介紹HTML/CSS實現常見企業網站布局的方法
4 回答如何實現“當前頁的頁碼要顯示紅色背景”?
2 回答logo的背景色顯示不出來
1 回答為什么背景色沒有顯示?
2 回答為什么只顯示em背景只顯示藍色
1 回答請大神教我 如何定義當前頁碼的CSS樣式?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2019-06-02
a:focus
{
? ?background-color:red;
}
2019-05-15
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>頁碼的制作</title>
<style>
/*在此定義相關CSS樣式*/
.page a{
? ? border:1px solid #e8e8e8;
? ? background-color:#fff;
? ? padding:5px 10px;
? ? margin:5px;
}
.page a:hover,.page a:active
{
? ? background:#c00;
}
</style>
</head>
<body>
<!--在此制作頁碼的基本結構-->
<div class="page">
? ? <a herf="#">首頁</a><a herf="#"><</a><a herf="#">1</a><a herf="#">2</a><a herf="#">3</a><a herf="#">...</a>
? ? <a herf="#">></a><a herf="#">末頁</a>
</div>
</body>
</html>
2018-01-02
我覺得是a:hover跟a:visited設為紅色?
2017-08-11
先給比如第一頁設置一個名為class的類。定義這個類的樣式為background-color:red,就可以把第一頁設置為當前頁,具體的當前頁是哪一頁的點擊事件需要用javascript去設置
2017-08-01
a:link {color: #FF0000} /* 未訪問的鏈接 */
a:visited {color: #00FF00} /* 已訪問的鏈接 */
a:hover {color: #FF00FF} /* 鼠標移動到鏈接上 */
a:active {color: #0000FF} /* 選定的鏈接 */