【问题标题】:How to add borders to a mat-raised-button?如何为垫子凸起的按钮添加边框?
【发布时间】:2019-09-01 11:01:39
【问题描述】:

下面的代码不起作用。我尝试对没有“垫升按钮”属性的按钮使用相同的样式并且它可以工作,所以我认为这可能是一些问题。

如何为垫子按钮添加边框和边框颜色?

添加.html

<button mat-raised-button class="light-button" [routerLink]="[addLink]">
   Add
</button>

styles.css

.light-button {
    height: 50px; 
    width: 150px;
    font-size: 110%;
    border-style: solid;
    border-color: blue;
    background-color: white;
}

【问题讨论】:

    标签: angular angular-material


    【解决方案1】:

    您应该将样式添加到组件的 css 中,或者如果您想在全局 style.css 中设置,您应该使用 !important 覆盖材质样式:

    .light-button {
        height: 50px; 
        width: 150px;
        font-size: 110%;
        border: 2px solid blue !important;
    } 
    

    demo ??

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-17
      • 1970-01-01
      • 1970-01-01
      • 2021-03-28
      • 2020-11-15
      • 1970-01-01
      相关资源
      最近更新 更多