【问题标题】:Angular 9 mat-form-field no outline, no labelAngular 9 mat-form-field 没有轮廓,没有标签
【发布时间】:2021-02-14 16:26:28
【问题描述】:

请告诉我如何摆脱 mat-form-fields 中的“线”! 请看附图以便更好地理解!

谢谢!

这是我的代码:

HTML CODE
    <div formGroupName="settingsfield" fxLayout="column">
        <mat-form-field fxFlex class="mat-block">
            <input type="number" min="10" max="12000" matInput
                    formControlName="mysettings1">
        </mat-form-field>
     </div>


CSS
.mat-form-field:not(.mat-form-field-has-label) .mat-form-field-infix {
 border-top-width: 0;
 }

.mat-form-field-wrapper {
 padding-bottom: 0px;
 margin-bottom: 0px;
 margin-top: 0px;
 }

.mat-form-field-label-wrapper {
 padding-top: 0px;
 padding-bottom: 0px;
 margin-bottom: 0px;
 margin-top: 0px;
 }

【问题讨论】:

  • 您能否提供问题可重现的 stackblitz 来检查代码,这样更容易理解问题的确切位置;)

标签: html css angular mat-form-field


【解决方案1】:
::ng-deep .mat-form-field-underline{
  display:none;
}

通常是这样完成的!但它在你的牢房中间。如果这不起作用,请提供一个 stackblitz 示例。

【讨论】:

  • 它正在工作!该行不再显示!非常感谢!
猜你喜欢
  • 2023-01-27
  • 1970-01-01
  • 2020-01-16
  • 2020-09-17
  • 1970-01-01
  • 2019-05-23
  • 2021-11-14
  • 2018-07-11
  • 1970-01-01
相关资源
最近更新 更多