首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Tipsy Tooltip箭头故障

Tipsy Tooltip箭头故障
EN

Stack Overflow用户
提问于 2012-03-12 01:22:26
回答 2查看 1.5K关注 0票数 0

我正在用tipsy工具提示制作一个工具栏。我改变了CSS以改变颜色,然后我为箭头做了一个图像。这里有一个图像的链接:http://www.novaprogramming.com/tipsy.png颜色是:#454545,由于某种原因,它不会显示?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-03-12 02:10:34

因为箭头图像是一个图像,所以sprite...you需要指定背景位置属性。检查http://jsfiddle.net/hwsns/2/中的tis。注意我添加的css

票数 1
EN

Stack Overflow用户

发布于 2012-03-12 02:17:56

您的箭头存储在css精灵中,这意味着您需要正确设置背景位置,以便显示箭头。精灵中有4个箭头:北、东、南和西,每个箭头都位于相应边缘的中心。对于这些箭头,您当前的css假设箭头始终位于一个角上,但事实并非如此。要显示箭头,您必须像这样更正这些属性:

代码语言:javascript
复制
.tipsy-n .tipsy-arrow {
    background-position: center top;
    left: 50%;
    margin-left: -4px;
    top: 0;
}
.tipsy-s .tipsy-arrow {
    background-position: center bottom;
    bottom: 0;
    left: 50%;
    margin-left: -4px;
}
.tipsy-e .tipsy-arrow {
    background-position: right center;
    height: 9px;
    margin-top: -4px;
    right: 0;
    top: 50%;
    width: 5px;
}
.tipsy-w .tipsy-arrow {
    background-position: left center;
    height: 9px;
    left: 0;
    margin-top: -4px;
    top: 50%;
    width: 5px;
}

背景位置的第一个值指定图像的水平位置,第二个值指定图像的垂直位置。您还可以使用百分比值而不是关键字,如下所示:

代码语言:javascript
复制
.tipsy-n .tipsy-arrow {
    background-position: 50% 0;
    left: 50%;
    margin-left: -4px;
    top: 0;
}
.tipsy-s .tipsy-arrow {
    background-position: 50% 100%;
    bottom: 0;
    left: 50%;
    margin-left: -4px;
}
.tipsy-e .tipsy-arrow {
    background-position: 100% 50%;
    height: 9px;
    margin-top: -4px;
    right: 0;
    top: 50%;
    width: 5px;
}
.tipsy-w .tipsy-arrow {
    background-position: 0 50%;
    height: 9px;
    left: 0;
    margin-top: -4px;
    top: 50%;
    width: 5px;
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9657105

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档