CSS:在FireFox中无法正常工作之后

时间:2015-08-11 02:54:01

标签: jquery html css

我知道之前已经问过这个问题,但建议的workaround在firefox中并不适合我,尽管在Chrome和IE浏览器中同样适用。 " +"和" - "标志似乎低于标题,标题应位于标题顶部的中间位置。以下是小提琴:

http://jsfiddle.net/7tg188u5/1/

#accordion [aria-selected="false"] .panel-title a:after{
    font-family: 'Glyphicons Halflings';
    content: "\2b";
    float: right;
    color: red !important;
    font-size: 1em; line-height: 1.5em;
    position: relative;
    display:inline-block;
}
#accordion  [aria-selected="true"] .panel-title a:after{
    font-family: 'Glyphicons Halflings';
    content: "\2212";
    float: right;
    color: red !important;
    font-size: 1em; line-height: 1.5em;
    position: relative;
    display:inline-block;
}

enter image description here

2 个答案:

答案 0 :(得分:2)

#accordion .panel-heading .panel-title {
    position: relative;   /* <<< New rule */
}
#accordion [aria-selected="false"] .panel-title a:after{
font-family: 'Glyphicons Halflings';
    content: "\2b";
    float: right;
    color: red !important;
    font-size: 1em; line-height: 1.5em;
    position: absolute;   /* <<< New rule */
    right: 0; top: 0;     /* <<< New rule */
    display:inline-block;
}
#accordion  [aria-selected="true"] .panel-title a:after{
    font-family: 'Glyphicons Halflings';
    content: "\2212";
    float: right;
    color: red !important;
    font-size: 1em; line-height: 1.5em;
    position: absolute; /* <<< New rule */
    right: 0; top: 0;   /* <<< New rule */
    display:inline-block;
}

请注意上面显示已调整行的注释,这是使用&#34;解决方法&#34;你正确地联系了。你最有可能想要调整右/行高,因为这真的让他们紧紧抓住角落,但这应该可以正常工作。

答案 1 :(得分:2)

试试这个:

.accordion-toggle {
    width: 100%;
    display: block;
    position:relative;
}
#accordion [aria-selected="false"] .panel-title a:after{
    font-family: 'Glyphicons Halflings';
    content: "\2b";
    right:10px;
    color: red !important;
    font-size: 1em; line-height: 1.5em;
    position: absolute;
    display:inline-block;
}
#accordion  [aria-selected="true"] .panel-title a:after{
    font-family: 'Glyphicons Halflings';
    content: "\2212";
    right:10px;
    color: red !important;
    font-size: 1em; line-height: 1.5em;
    position: absolute;
    display:inline-block;
}
.padding0
{
    padding:0px;
}

这是更新的jfiddle