【问题标题】:change border radius of mat-flat-button on angular在角度上更改 mat-flat-button 的边框半径
【发布时间】:2019-09-19 15:48:04
【问题描述】:

我正在开发一个有角度的应用程序,并想更改 mat-flat-button 的边框半径。我可以使用 css 更改按钮的背景颜色,但不能更改边框半径。我的代码

    <div  flexLayout = "row">
                    <button class="flat_button" (click)="toggle_color()" mat-flat-button>B2-L1</button>
                    <button mat-flat-button>B2-L3</button>
                    <button mat-flat-button>B2-L3</button>
                    <button mat-flat-button>B2-L4</button>

    </div>

.css

 .mat-flat-button {
      background-color: grey;
      border-radius: 0 px;  
  }

  .mat-button {
    border-radius: 0 px;     
  }

有人可以帮我解决这个问题吗?

【问题讨论】:

    标签: css angular button angular-material


    【解决方案1】:

    材质按钮通常具有相同的类添加到按钮。如果您为按钮类分配某种样式,它应该反映在屏幕上。尝试如下:

    .mat-button, 
    .mat-flat-button, 
    .mat-icon-button, 
    .mat-stroked-button { 
      border-radius: 0px; 
    }
    

    【讨论】:

    • .mat-button, .mat-flat-button, .mat-icon-button, .mat-stroked-button { border-radius: 0px; }
    猜你喜欢
    • 1970-01-01
    • 2019-01-04
    • 2018-05-07
    • 2011-10-27
    • 1970-01-01
    • 2022-01-15
    • 2019-01-09
    • 2017-12-25
    • 2022-01-03
    相关资源
    最近更新 更多