I have the following piece of code for md-input-container using angular material design:
<md-input-container>
<input mdInput [placeholder]="'common.password' | translate" type="password" formControlName="password" (change)="onPasswordChange($event.target.value)" required validate-onBlur/>
<md-hint *ngIf="frmLoginInfo.controls.password.pristine" class="s-text-caption s-hint">{{ 'signup.pwdRule' | translate }}</md-hint>
</md-input-container>
This container has a div inside with class (mat-input-wrapper) which has a padding of padding-bottom: 1.296875em.
How do I override this padding style of the container?
PS : Adding class to the container and making the padding: 0px as important also doesnt work.
Try this:
Update
Official Response from Angular about
/deep/
or>>>
(Thanks @DeborahK)From: http://angularjs.blogspot.co.uk/2017/07/angular-43-now-available.html
Another related question
Add a more specific style to the component - see CSS specificity
html
css
You need the
>>>
as explained hereHowever
/deep/
and>>>
are deprecated as explained hereLive plunker example
Use deep for styling
HTML
CSS
Important
.mat-input-wrapper
need to be a child ofwrapper
- from your example I don't know where that class come fromAfter your post update I think it should work the following:
#forceStyle > .mat-input-wrapper{padding-bottom: 0 !important}
- should work even without theimportant
but just to be sure.Make sure you clear cache and even relaunch the app because sometimes changes are not loaded