用CSS代码实现一个简单的链接提示效果

2015-12-14 0 727
用CSS代码实现一个简单的链接提示效果
<html>
<title>纯CSS链接提示效果</title>
<style>
div{
clear:both;
margin:5px 0 0 0;
font-size:12px;
line-height:22px;
}
a.alt{
position:relative;
background-color:#f8f8f8;
float:left;
width:158px;height:20px;
margin:0 auto;
border:1px solid #ccc;
text-align:center;
text-decoration:none;
color:#555;
}
a.alt:hover{background:#EEE; text-decoration:none;z-index:2;}
a.alt span{display:none;}
a.alt:hover span{
position:absolute;
display:block;
top:-1px;left:158px;
width:190px;border:1px solid #ccc;
z-index:1;
background-color:#fff;
}
</style>
</head>
<body>
<div><a class='alt' href="http://www.baidu.com" rel="external nofollow" ><span>全球中文搜索门户</span>百度一下</a></div>
<div><a class='alt' href="http://www.codesc.net/" rel="external nofollow" ><span>开源源码下载</span>源码素材网</a></div>
<div><a class='alt' href="http://www.oschina.net" rel="external nofollow" ><span>开源代码分享!</span>开源代码</a></div>
</body>
</html>

遇见资源网 css 用CSS代码实现一个简单的链接提示效果 http://www.ox520.com/14340.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务