首页 > Web开发 > 详细

[CSS3] Interactive Pseudo-Classes :link :visited :hover :active

时间:2015-12-18 06:52:53      阅读:287      评论:0      收藏:0      [点我收藏+]

The interactive pseudo-classes for links (and buttons) allow us to make sure the user knows what elements on the page are interactive and that they can use them to navigate the website.

 

Order is important: order -- link, then visited, then hover, then active.

a {
  text-decoration: none;
}
a:link {
  color: blue;
}
a:visited {
  color: purple;
}
a:hover {
  text-decoration: underline;
}
a:active {
  border: 1px solid;
}

 

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" type="text/css" href="link.css">
</head>
<body>
  <ul>
    <li><a href="http://egghead.io">Egghead</a></li>
    <li><a href="http://garthdb.com">Garth Braithwaite</a></li>
    <li><a href="http://google.com">Google</a></li>
    <li><a href="http://fakewebsite.notreal">Not a Website</a></li>
    <li><button>Click it!</button></li>
    <li><a id="named-anchor">Named Anchor</a></li>
  </ul>
</body>
</html>

 

[CSS3] Interactive Pseudo-Classes :link :visited :hover :active

原文:http://www.cnblogs.com/Answer1215/p/5055917.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!