1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 微信小程序 - 修改 button 样式 边框和背景色

微信小程序 - 修改 button 样式 边框和背景色

时间:2024-07-02 05:21:24

相关推荐

微信小程序 - 修改 button 样式 边框和背景色

wxml代码:

<view><button class="publish" disabled="{{disabled}}" bindtap='submit'>发表</button></view>

css代码:

/* 去掉按钮边框方法一 */.publish::after {border: none;}/* 去掉按钮边框方法二 */.publish::after {border: 0;}

设置透明按钮:

.publish{ width:100%;margin: 0 auto;display:block;color: #CDB03B;background: transparent; /*设置背景颜色一致*/border-color: transparent; /*设置边框颜色一致*//* background-color: rgba(255,255,255,0); */}.publish::after{ border: none; /*设置边框取消*/}

button 设置 disabled 之后背景颜色和字体颜色的值都是默认的 ,需要修改 disabled 背景颜色和字体颜色。

/* 修改默认背景色 */.publish[disabled][type="default"], wx-button[disabled]:not([type]) {color: #7f8389;background-color: white;border-color: white;}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。