簡體   English   中英

ng-bootstrap手風琴將樣式應用於子圖標

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

當不關注手風琴時,星星顯示

當沒有關注手風琴時,星星顯示

在此處輸入圖片說明

當關注手風琴時,星星消失

這是我的CSS,用於顯示手風琴左側的星星:

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

這是標記[用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>

我的目標是在某些手風琴元素旁邊放一個星星,上面放一個標題。 (本機工具提示)

我嘗試了很多事情,但似乎無法解決此問題。 有沒有人有什么建議?

嘗試深

/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