Search code examples
cssangularangular-materialangular-templateangular-material-7

Angular Material - how to set mat-horizontal-content-container padding 0


Im using angular material stepper. I need set padding 0 on mobile view.On developer console i could set padding 0 by changing .mat-horizontal-content-container. But its not working when i add .mat-horizontal-content-container{padding:0 !important;}Is there any solution to this problem?


Solution

  • You need to use the ::ng-deep pseudo selector, see https://blog.angular-university.io/angular-host-context/#thengdeeppseudoclassselector

    :host ::ng-deep .mat-horizontal-content-container {
        padding:0 !important;
    }