hao*_*ern 1 angular-material angular
下面的代码不起作用。我尝试对没有“mat-raised-button”属性的按钮使用相同的样式并且它有效,所以我认为这可能是一些问题。
如何为 mat-buttons 添加边框和边框颜色?
添加.html
<button mat-raised-button class="light-button" [routerLink]="[addLink]">
Add
</button>
Run Code Online (Sandbox Code Playgroud)
样式文件
.light-button {
height: 50px;
width: 150px;
font-size: 110%;
border-style: solid;
border-color: blue;
background-color: white;
}
Run Code Online (Sandbox Code Playgroud)
您应该将样式添加到组件的 css 中,或者如果要在全局 style.css 中进行设置,则应使用!important覆盖材料样式:
.light-button {
height: 50px;
width: 150px;
font-size: 110%;
border: 2px solid blue !important;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6613 次 |
| 最近记录: |