Home  >  Article  >  Web Front-end  >  鼠标滑过链接出现信息框效果_html/css_WEB-ITnose

鼠标滑过链接出现信息框效果_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:29:541254browse

鼠标滑过链接出现信息框效果:
在超链接中有一个自带的效果,当鼠标悬浮在链接之上的时候,能够弹出提示框,使用title属性就可以实现。
代码如下:

<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>蚂蚁部落</title><style type="text/css">#box{  margin:100px;}a.tooltip{  position:relative;  color:blue;}a.tooltip span{  display:none;}a.tooltip:hover span {  display:block;  font-size:12px;  width:140px;  height:30px;  position:absolute;  top:-2em;  left:3em;  background-color:#ccc;  color:red;}</style></head><body><div id="box"><a href="#" class="tooltip">蚂蚁部落<span>创建于2012年,致力于前端知识的分享与交流。</span></a>欢迎您,只有努力奋斗才会有美好的未来。</div></body></html>

例子不够美观,这里只是用来进行演示而已,代码非常的简单,这里就不多介绍了,如果有任何问题可以跟帖留言。

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=13424

更多内容可以参阅:http://www.softwhy.com/divcss/

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn