简体   繁体   English

ng-bootstrap手风琴将样式应用于子图标

[英]ng-bootstrap accordion applies style to child icons

当不关注手风琴时,星星显示

Star shows when there is no focus on the accordion 当没有关注手风琴时,星星显示

在此处输入图片说明

Star dissappears when there's focus on the accordian 当关注手风琴时,星星消失

Here's my CSS to display the star to the left of the accordion: 这是我的CSS,用于显示手风琴左侧的星星:

.icon-star2.relevant-source {
  position: absolute;
  margin-left: -5em;
}

Here's the markup[replaced variables with x to hide sensitive info]: 这是标记[用x替换变量以隐藏敏感信息]:

 <ngb-accordion class="accordion accordion-alternate">
           <ngb-panel class="source-accordion" *ngFor="x">
                            <ng-template ngbPanelTitle>
                                <i *ngIf="x > 0" class="icon-star2 relevant-source"
                                   title="This source contains {{x}} of the top 10 most relevant documents.">
                                </i>
                                <span class="source-link source-link-text">{{x}}</span><span class="float-right source-link">
                                {{x | number:0 }}</span>
                            </ng-template>
                            <ng-template ngbPanelContent>
                                List of documents
                            </ng-template>
                        </ngb-panel>
                    </ngb-accordion>

My goal is to have a star next to certain accordion elements with a title on it. 我的目标是在某些手风琴元素旁边放一个星星,上面放一个标题。 (native tooltip) (本机工具提示)

I've tried a handfull of things but I can't seem to get this issue resolved. 我尝试了很多事情,但似乎无法解决此问题。 Does anyone have any suggestions? 有没有人有什么建议?

try with deep 尝试深

/deep/ ngb-accordion > ngb-panel> i.icon-star2.relevant-source{
 position: absolute;
 margin-left: -5em;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM