Angular Material matInput content aligned to the right
15,631
Using the standard text-align
CSS property should just work.
<input matInput class="right">
.right { text-align: right }
![trashvin](https://lh5.googleusercontent.com/-XjMv_o4wXzY/AAAAAAAAAAI/AAAAAAAAEhw/LDYxM4D8n1c/photo.jpg?sz=256)
Author by
trashvin
Updated on July 06, 2022Comments
-
trashvin almost 2 years
How do we align the input of matInput in Angular Material to the right?
My current code:
<mat-form-field> <input matInput type="number" id="amount" placeholder="Amount" [ngModel]="entry.amount | number :'1.2-2'" (ngModelChange)='entry.amount=$event' /> </mat-form-field>
Desired output :