I am showing Angular error messages using the following code:
<mat-error>
{{error}}
</mat-error>
Sometimes I need to change the left position of the error message. The class that responsible for showing errors is this: ".mat-mdc-form-field-error-wrapper".I can override it like this:
.mat-mdc-form-field-error-wrapper {
left: -210px !important;
}
Which works. However, it changes error position everywhere. Any idea how to accomplish it?
Thanks
2
Answers
**You can try this **
}
when you use some like
See that the class "custom" is applied to the "mat-error" tag, so you should change some class of this "tag" you can use simple
If you want more specificy, for example to change the color you can use
NOTE: avoid use !important, really it’s a headache when in a future you will want change a .css if it’s full plenty of "importants"