我正在为我正在开发的网站实现一个工具提示,我找到了这个解决方案,但我想不出一种动画方法。
我想要做的是向下滑动工具提示。
代码如下。任何帮助表示赞赏。
HTML:
<a href="#" title="This is some information for our tooltip." class="tooltip">
<span title="More">CSS3 Tooltip</span>
</a>
CSS:
<style type="text/css">
.tooltip{
display: inline;
position: relative;
}
.tooltip:hover:after{
background: #333;
background: rgba(0,0,0,.8);
border-radius: 5px;
bottom: 26px;
color: #fff;
content: attr(title);
left: 20%;
padding: 5px 15px;
position: absolute;
z-index: 98;
width: 220px;
}
.tooltip:hover:before{
border: solid;
border-color: #333 transparent;
border-width: 6px 6px 0 6px;
bottom: 20px;
content: "";
left: 50%;
position: absolute;
z-index: 99;
}
</style>