[英]How to add borders to a mat-raised-button?
The code below is not working. 下面的代码不起作用。 I tried using the same styling for a button without a 'mat-raised-button' property and it works, so I think it is probably some issue with this.
我尝试对没有'mat-raised-button'属性的按钮使用相同的样式,并且它可以工作,所以我认为这可能是一个问题。
How do I add borders and border colours to mat-buttons? 如何为边框按钮添加边框和边框颜色?
add.html add.html
<button mat-raised-button class="light-button" [routerLink]="[addLink]">
Add
</button>
styles.css styles.css
.light-button {
height: 50px;
width: 150px;
font-size: 110%;
border-style: solid;
border-color: blue;
background-color: white;
}
you should add your styles to css of your component or if you want to set in global style.css you should use !important
to override material style : 您应该将样式添加到组件的CSS中,或者如果要设置为全局style.css,则应使用
!important
覆盖材质样式:
.light-button {
height: 50px;
width: 150px;
font-size: 110%;
border: 2px solid blue !important;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.