3

Can i change the floating default purple color of the lable?

 <mat-form-field>
 <input matInput placeholder="My Lable" formControlName="my-Lable">
</mat-form-field>
Indrakumara
  • 1,595
  • 17
  • 22
Geeth
  • 31
  • 1
  • 3

2 Answers2

4

I prefer <mat-label></mat-label> than *placeholder*

<mat-form-field>
<mat-label>Agent Code</mat-label>
<input matInput>
</mat-form-field>

then you just call it in css

mat-label {
  color: blue;
}
Jay
  • 135
  • 8
2

User color attribute of material theme: color="primary" or "accent" or "warn",for extra colors you can use custom themes,or override color in css file.

 <mat-form-field color="accent"> <------here
   <input matInput placeholder="My Lable" formControlName="my-Lable">
 </mat-form-field>
Nenad Radak
  • 3,550
  • 2
  • 27
  • 36