我用的是Angular
、Angular Material
和CSS
我的mat-form-field
代码如下.
<mat-form-field class="custom-form-field" appearance="outline" style="padding-top: 0px;padding-bottom: 0px; line-height: 0px;">
<input style="padding-top: 0px; padding-bottom: 0px;" matInput type="text" id="onSearch" (keyup)="keyUp($event)">
<mat-icon matPrefix class="centered-icon">search</mat-icon>
</mat-form-field>
有了这个,当我判断这一部分时,前端看起来像这样
mat-form-field
占据了额外的绿色,所以复选框被取消了.
即使我设置padding-bottom: 0px
或margin-bottom: 0px
,它仍然占据那个空间.
如何消除这种空间?