微信小程序自定义 button样式
- wxml
<view class="fixedBottom">
<button class="btn" style="width:100%; height: 100%;"formType="submit">保存</button>
</view>
- wxss
.fixedBottom{
position: fixed;
bottom: 20rpx;
left: 0rpx;
width: 94vw;
margin-left: 3vw;
height: 100rpx;
border-radius: 10rpx;
text-align: center;
}
.btn{
background-color: red;
color: #FFF;
}
注意:
1、修改button背景颜色时,不能填写type.
2、修改尺寸时,在button写行间样式 height:100% width:100%, 外面套个标签盒子
未完待续