我想设置ng bootstrap下拉菜单的样式,基本上将其宽度更改为auto。但是我不知道如何使用/ deep /链接来定位它。
我想定位ngbDropdownMenu。
这是它的HTML:
<div ngbDropdown class="d-inline-block">
<button class="btn btn-custom" id="columnToggle" ngbDropdownToggle ngbTooltip="Filter">
<fa-icon [icon]="faColumns" title="Select to Show/Hide Columns"></fa-icon>
</button>
<div ngbDropdownMenu aria-labelledby="columnToggle">
<button class="dropdown-item" *ngFor="let column of columnList">
<label>
<input type="checkbox" [checked]="column.selected" (change)="changeSelectedColumns.emit(column)" [disabled]="column.disabled"
/> {{column.header}}
</label>
</button>
</div>
</div>
答案 0 :(得分:0)
您可以将一个类添加到div nbgDropdownMenu
<div ngbDropdownMenu aria-labelledby="dropdownBasic1" class="custom">
<button class="dropdown-item">Action - 1</button>
<button class="dropdown-item">Another Action</button>
<button class="dropdown-item">Something else is here</button>
</div>
.custom{
background-color:Red;
width:auto;
padding:20px;
}