設(shè)置超鏈接的樣式示例:
a:link 超鏈接被點(diǎn)前狀態(tài)
a:visited 超鏈接點(diǎn)擊后狀態(tài)
a:hover 懸停在超鏈接時(shí)
a:active 點(diǎn)擊超鏈接時(shí)
在定義這些狀態(tài)時(shí),有一個(gè)順序l v h a。
(推薦教程:html教程)
代碼區(qū):
<!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>無(wú)標(biāo)題文檔</title> <style type="text/css"> a:link { color:#000; text-decoration:none;} a:visited { color:#000; text-decoration:none;} a:hover { color:#F00; text-decoration:underline;} a:active { color:#F90; text-decoration:underline;} </style> <link href="Untitled-1.css" rel="stylesheet" type="text/css" /> </head> <body> <a href="http://www.baidu.com/">百度一下</a> </body> </html>
運(yùn)行顯示:鼠標(biāo)箭頭未放到“百度一下”,其顯示黑色——放上時(shí),其顯示紅色——點(diǎn)擊“百度一下”鏈接時(shí),其顯示橙色——點(diǎn)擊后,其顯示黑色。
相關(guān)視頻教程推薦:html視頻教程