提示箭头向右(Tooltip arrow right)

2019-10-16 22:59发布

我试图让这个提示箭头指向朝链接的权利。

CSS

.tooltipside
{
position: relative;
cursor: help;
display: inline-block;
outline: none;
}

.tooltipside span
{
visibility: hidden;
position: absolute; 
bottom: -22px;

z-index: 999;
width: 52px;
margin-left: -63px;
padding: 2px;
border: 1px solid #80a7ba;
background-color: white;                     
-moz-border-radius: 4px;
border-radius: 4px;  
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.5) inset;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.5) inset;
box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.5) inset;  
text-shadow: 0 1px 0 rgba(255,255,255,.4); 
}

.tooltipside:hover
{
border: 0; /* IE6 fix */
}

.tooltipside:hover span
{
visibility: visible;
}

.tooltipside span:before,
.tooltipside span:after
{
content: "";
position: absolute;
z-index: 1000;
bottom: -7px;
left: 50%;
margin-left: -8px;  
border-top: 8px solid #80a7ba;
border-left: 8px solid transparent;
border-right: 8px solid transparent;        
border-bottom: 0;  
}

.tooltipside span:before
{
border-top-color: #ccc;
bottom: -8px;
}

在HTML是

 <a href='#' class='tooltipside'><span>
 <img src='http://cdn2.iconfinder.com/data/icons/32pxmania/misc_57.png' 
  border='0' width='52' height='52'></span>LINK</a> TEST TEST TEST</b>​

目前,它在提示我需要它指向正确的朝向接的中心指向下方。 我会怎么做呢?

谢谢

Answer 1:

这是你所追求的? http://jsfiddle.net/kX5kH/

我使用的定位移动的箭头,然后周围的透明broders交换,使箭头指向正确的方式。

注:我添加了一个父<div>和定位这是绝对的,因为它是否则拥抱边缘,你看不到的工具提示。

还没有开始<b>标签。

最后一点,我注意到你有一个IE6补丁 ,这是耐人寻味的,因为这些都不能工作在IE6。 框的阴影,前/后选择,透明的边框将无法正确显示。 但老实说,我不关心IE6 = P

希望这可以帮助。



文章来源: Tooltip arrow right
标签: html css tooltip