【问题标题】:How to style the material checkbox in angular ?如何在 angular 中设置材质复选框的样式?
【发布时间】:2018-04-20 20:22:55
【问题描述】:

这是Angular 中的mat-checkbox 样式错误(如图)。 我怎样才能只保留小复选框? Click here to see the picture

【问题讨论】:

  • 请添加您尝试创建的复选框?

标签: javascript angular checkbox


【解决方案1】:

您应该在 CSS 文件中使用 ::ng-deep。 (ps.How and where to use ::ng-deep)

例子:

::ng-deep mat-checkbox.yourcheckbox .mat-checkbox-frame{
   border: 0px;
}

StackBlitz 示例: https://stackblitz.com/edit/angular-5j1aur?file=app%2Fcheckbox-configurable-example.css

【讨论】:

    猜你喜欢
    • 2015-09-09
    • 2019-04-23
    • 2020-04-18
    • 2020-02-22
    • 2023-03-28
    • 2018-03-29
    • 2020-10-17
    • 1970-01-01
    • 2017-09-27
    相关资源
    最近更新 更多