请问如何更改button disabled的样式
发布于 6 年前 作者 guiying69 4731 次浏览 来自 问答

wxml 文件:

<button class="btn-list" catchtap="answerNext" disabled="">下一题</button>

wxss 文件:

button:disabled {
color:#e3e3e3 !important;
border:1px solid #e3e3e3 !important;
}


js 文件:

data:{
 disabled:true
}

我想改button 在disable=“true”时按钮的边框和字体颜色,但是页面没有奏效,教程中也没有说明,请问如何更改?

2 回复

加了button[disabled]{color:#e3e3e3!importantborder :1px solid #e3e3e3 !important;}报错了,界面样式也没有了

button[disabled]{

color:#e3e3e3 !important;
border:1px solid #e3e3e3 !important;

}

回到顶部