微信小程序如何解决botton按钮对齐问题

如果botton不在其他控件下层,或者上层控件类型不为flex,可以用float调整botton显示位置,如float=right,则botton显示在右侧。

html 复制代码
<button type="primary" style="float: right;">测试</button>

<view style="display: block;">
  <button type="primary" style="float: right;">测试</button>
</view>

如果botton上层控件类型为flex,可以通过设置position=absoluted调整显示位置。

html 复制代码
<view style="display: flex;">
  <button type="primary" style="position: absolute;right: 0;">测试</button>
</view>

更多微信小程序内容欢迎关注博主。

有帮助欢迎打赏。

相关推荐
captain3761 天前
MyBatis(入门5)其他查询操作
java·数据库·spring boot·mybatis
jktantan1 天前
Vue keep-alive 切标签后滚动位置回顶?因为 onDeactivated 里读到的 scrollTop 是 0
前端·javascript·vue.js
Novproxy_Z1 天前
商用代理避坑:如何识别商家拿机房 IP 冒充住宅 IP
java·网络·tcp/ip
无足鸟ICT1 天前
【RHCA+】vmstat命令(监控系统资源)
linux·服务器
垆边人似月.1 天前
RDMA 文件传输踩坑(五):READY 发送成功后,为什么出现 Work Request Flushed Error?
服务器·网络·tcp/ip
闪亮的路灯1 天前
Linux 安装mqtt服务mosquitto
linux·运维·服务器
HideF1 天前
nmcli
linux·服务器·网络
文丑颜不良啊1 天前
LeetCode1481~1500题目解析
java·leetcode
2601_962885721 天前
quotes 字段全解:涨跌幅、振幅、换手率的口径与单位
java·前端·spring
excel1 天前
encodeURI 和 encodeURIComponent 有什么区别?
前端