Angular Material mdInput border around the control

后端 未结 5 1252
深忆病人
深忆病人 2021-01-05 15:07

I would like to style my mdInput control to have a black box around it:

    
      

        
5条回答
  •  长发绾君心
    2021-01-05 15:36

    Try this:

    ::ng-deep .mat-input-wrapper{
     background-color:black; 
    }
    

    or (depending what you need)

    ::ng-deep .mat-input-wrapper{
       border: 2px solid black;
    }
    

    DEMO

    encapsulation: ViewEncapsulation.None has it's downside, that it will affect all the classes, you wish it or not. It's still not deprecated and I think it will be just replaced by something else.

提交回复
热议问题