根据问题,如何更改离子按钮内的文本颜色?这是我按钮的代码
<button ion-button block (click) = "submitForm()">Submit</button>
我尝试了各种方法,如下所示
<button ion-button block (click) = "submitForm()"><sub ion-text color = "light">Submit</sub></button>
<button ion-button block (click) = "submitForm()" ion-text color = "light">Submit</button>
<button ion-button block (click) = "submitForm()"><span ion-text color = "light">Submit</span></button>
<button ion-button block (click) = "submitForm()" class= "font-white">Submit</button>
在上面的最后一个例子中我把 .font-white{color: #fff !important;}
放在 app.scss
里面
但没有任何作用 .
2 回答
只需将按钮中的
style
属性替换为class
name,然后在app.scss
但代码下方(假设您将类名称设为font-white
)按以下方式修改 component.html 和 component.scss 文件,
在你的 component.scss 中,