![](/img/trans.png)
[英]How to get margin left size using javascript when I use margin auto property in css
[英]How to move span to left with margin auto Css angular 4
如何將那些用名稱突出顯示的數字移動到左邊。 我已經嘗試過flex方向margin auto等,但我無法得到理想的結果。
這是我的HTML代碼
<section class="favorites">
<div class="category" *ngFor="let category of categoryKeys">
<div class="sub-header">{{category}}</div>
<app-custom-accordion [closeOthers]="true">
<ngb-panel [disabled]="panel.Tests.length === 0" *ngFor="let panel of testSelectionSession.FavoritesByCategory[category]"
id="{{panel.Id}}" [title] = "panel.Name">
<ng-template ngbPanelTitle>
<span class="test-length" style=""> {{ '(' + panel.Tests.length + ')'}}</span>
<div class="action-items">
<span class="icon-set" [ngClass]="{'same-day-2x': isSameDay(panel.Code), 'next-day-2x': isNextDay(panel.Code)}"></span>
<label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" [name]="panel.Id + '-' + panel.Moniker" [ngModel]="checkAllTestsSelected(panel)"
(ngModelChange)="onPanelCheckboxUpdate($event, panel)" [id]="panel.Id + '-' + panel.Moniker">
<span class="custom-control-indicator"></span>
</label>
</div>
</ng-template>
</ngb-panel>
</app-custom-accordion>
我想把這個標簽移到左邊
<span class="test-length" style=""> {{ '(' + panel.Tests.length + ')'}}</span>
有人可以幫我解決這個問題嗎?
最簡單的解決方案將包括
'(' + panel.Tests.length + ')'
在小組標題中:
<ngb-panel [disabled]="panel.Tests.length === 0" *ngFor="let panel of testSelectionSession.FavoritesByCategory[category]"
id="{{panel.Id}}" [title] = "panel.Name + '(' + panel.Tests.length + ')'">
該組件非常類似於一個表,使得單獨浮動列的內容似乎很難實現。 雖然我不熟悉ngb-panel
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.