更新时间:2023-02-02 12:19:36
<div class="mat-form-field-infix">
<input class="mat-input-element mat-form-field-autofill-control cdk-text-field-autofill-monitored" ma
tinput="" placeholder="Enter First name"
ng-reflect-placeholder="Enter First name" id="mat-input-0" aria-describedby="mat-hint-0" aria-invalid="false" aria-required="false">
<span class="mat-form-field-label-wrapper">
<label class="mat-form-field-label id="mat-form-field-label-1" for="mat-input-0" aria-owns="mat-input-0">
<mat-label _ngcontent-nbv-c4="" class="ng-star-inserted">First Name</mat-label>
</label>
</span>
</div>
样式覆盖
.mat-form-field-appearance-outline .mat-form-field-infix {
padding: 10px;
}
.mat-form-field-infix {
padding:0;
border-top: 0;
}
//change top and padding-top as per required
.mat-form-field-label-wrapper {
top: -0.84375em;
padding-top: 0.84375em;
}