微信小程序如何解决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>

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

有帮助欢迎打赏。

相关推荐
bloglin999995 小时前
scp、rsync远程文件同步
linux·运维·服务器
迦南的迦 亚索的索5 小时前
LINUX环境
linux·运维·服务器
yuanjj885 小时前
linux下调试域格CLM920 NC5等9x07平台模块 QMI拨号
linux·运维·服务器
懂懂tty5 小时前
React状态更新流程
前端·react.js
IMPYLH5 小时前
Linux 的 printenv 命令
linux·运维·服务器·bash
SilentSamsara6 小时前
SSH 远程管理:密钥登录 + 隧道转发,一次性配置好
linux·运维·服务器·ubuntu·centos·ssh
小码哥_常6 小时前
告别繁琐!手把手教你封装超实用Android原生Adapter基类
前端
HoneyMoose6 小时前
Jenkins Cloudflare 部署提示错误
java·servlet·jenkins
阿丰资源6 小时前
基于SpringBoot的物流信息管理系统设计与实现(附资料)
java·spring boot·后端
skywalk81636 小时前
pytest测试的时候这是什么意思?Migrating <class ‘kotti.resources.File‘>
前端·python