2013-10-27 48 views
0

我尝试过这一切的最后2天在底部jQuery UI的标签,我无法使箭头的活动标签

来破坏我的大脑,这是我的小提琴 http://jsfiddle.net/wd7a6/

我已经添加了箭头在活跃的标签,但我不能将它定位

请让我知道我做错了

.ui-state-active a::before { 
    content: ""; 
    position: absolute; 
    height: 0; 
    border-left: 10px solid transparent; 
    border-right: 10px solid transparent; 
    border-bottom: 10px solid black; 
    top:-20; 
    display:block; 
} 

对不起的不是b eing能够Ø解释正确地看到的截图,你就会明白

+0

? –

+0

我用屏幕截图更新了我的问题 – San

回答

0

DEMO

.ui-state-active a::before { 
    content: ""; 
    position: absolute; 
    height: 0; 
    border-left: 10px solid transparent; 
    border-right: 10px solid transparent; 
    border-bottom: 10px solid black; 
    top: -5px;//added this 
    left: 20px;//added this 
    display: block; 
} 
你想在那里放置
+1

谢谢Tushar我尝试了同样的方法,它工作。你可以在www.spheretekk.com/bc上看到。非常感谢 – San

+0

@San欢迎高兴帮助:)。 –

0

假设你想用文字的箭头左对齐:

.ui-state-active a:before { 
    content: ""; 
    position: relative; /*Use relative to ensure that the generated content is not removed from normal document flow, otherwise it will overlap the other content */ 
    height: 0px; 
    border-left: 10px solid transparent; 
    border-right: 10px solid transparent; 
    border-bottom: 10px solid black; 
    top: 0px; 
    left: -10px; /* specify a negative left to control offset on the left */ 
    display: inline-block; /*Use inline-block to ensure that the generated content stays inline with the other content */ 
} 

演示:http://jsfiddle.net/wd7a6/1/

如果你想要右对齐与文本一起使用:after,并为标签文本的偏移指定一个正向左侧。

演示:http://jsfiddle.net/wd7a6/2/