简体   繁体   English

Angular 9 mat-form-field 无轮廓,无标签

[英]Angular 9 mat-form-field no outline, no label

Please tell me how can I get rid of the "line" in mat-form-fields !请告诉我如何摆脱 mat-form-fields 中的“线”! Please take a look at the attached picture for better understanding !请看一下附图以便更好地理解!

Thank You !谢谢你 !

Here is my code :这是我的代码:

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;
 }

在此处输入图片说明

::ng-deep .mat-form-field-underline{
  display:none;
}

It is usually done this way!通常是这样做的! But its in the middle of the cell for you.但它在你的细胞中间。 If this doesn't work, kindly provide a stackblitz example.如果这不起作用,请提供一个 stackblitz 示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM