通過CSS樣式修改超連結顏色下劃線
阿新 • • 發佈:2019-01-05
HTML檔案:
<style type="text/css">
a:link {color:#000000;} /* 未訪問連結*/
a:visited {color:#00FF00;} /* 已訪問連結 */
a:hover {color:#FF00FF;} /* 滑鼠移動到連結上 */
a:active {color:#0000FF;} /* 滑鼠點選時 */
</style>
CSS檔案:
a:link{color:#000000;} /* 未訪問連結*/ a:visited {color:#00FF00;} /* 已訪問連結 */ a:hover {color:#FF00FF;} /* 滑鼠移動到連結上 */ a:active {color:#0000FF;} /* 滑鼠點選時 */
去掉下劃線可以將a標籤的text-decoration屬性改為none的即可!
text-decoration:none;
示例:
<html> <head> <style type="text/css"> a:link {color:#000000;} /* 未訪問連結*/ a:visited {color:#00FF00;} /* 已訪問連結 */ a:hover {color:#FF00FF;} /* 滑鼠移動到連結上 */ a:active {color:#0000FF;} /* 滑鼠點選時 */ </style> <title>test css</title> </head> <body> <a>this a label</a> </body> </html>
以載入CSS檔案方式
<html>
<head>
<link rel="stylesheet" href="wcss.css" type="text/css" />
<title>test css</title>
</head>
<body>
<a>this a label</a>
</body>
</html>
非常簡單!