angular - ng-select - 改变高度
问题描述
我在 Angular 5 版本 1.4.2 中使用 ng-select 库https://github.com/ng-select/。我想对其进行自定义,以使 ng-select 的高度更小。如何做到这一点?我在https://github.com/ng-select/ng-select#custom-styles上查看了使用样式进行自定义,但无法使其正常工作。
我添加了一个定制的 CCS 来尝试执行此操作。
这是我的 ng-select 代码
<label class="col-sm-4 text-sm-right col-form-label">Payout Format</label>
<div class="col-sm-8">
<ng-select
[items]="payoutFormats"
[closeOnSelect]="true"
[searchable]="true"
bindValue="payoutBatchFormatID"
bindLabel="name"
placeholder="All"
[(ngModel)]="filter.payoutFormats"
name="payoutFormat"
class="custom">
</ng-select>
</div>
这是我为自定义它而添加的 CSS:
.ng-select.custom {
height:5px;
font-size: 0.8em;
}
.ng-select.custom .ng-select-container {
height:5px;
}
可以看出,我尝试在 2 个地方设置高度,但没有效果。我能够成功更改字体大小。
我需要它更小。
解决方案
推荐阅读
- github - Github Pages 不支持 Jekyll 主题
- configuration - Packer HCL2 配置文件支持
- javascript - 动态生成的字段增量问题的名称
- r - 使用具有多个可能名称的 ID 组合数据集
- python - 在Excel中查找不规则行数的平均值
- amazon-web-services - 通过 AWS SES 发送电子邮件是否仍取决于电子邮件托管的每日电子邮件数量限制?
- angular - Angular 9 - 服务返回/列表包含数据但 *ngFor 没有显示任何内容
- python - OpenCV Python:FloodFill 表现得很奇怪
- html - 我有一个没有项目符号的无序列表,动画消失在屏幕外。但是,最后三个字母不动
- algorithm - 查找所有 Coprime 子集,直到一个数字 N