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

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

有帮助欢迎打赏。

相关推荐
阿丰资源10 分钟前
基于Spring Boot的电影城管理系统(直接运行)
java·spring boot·后端
IT_陈寒12 分钟前
SpringBoot自动配置的坑差点让我加班到天亮
前端·人工智能·后端
xingpanvip12 分钟前
星盘接口开发文档:星相日历接口指南
android·开发语言·前端·css·php·lua
呱牛do it19 分钟前
企业级门户网站设计与实现:基于SpringBoot + Vue3的全栈解决方案(Day 8)
java
@PHARAOH24 分钟前
WHAT - GitLens supercharged 插件
前端
Lentou28 分钟前
日志轮询策略
linux·服务器·网络
TT模板44 分钟前
苹果cms整合西瓜播放器XGplayer插件支持跳过片头尾
前端·html5
你好,帅哥1 小时前
openssl ,msys2 ,交叉编译
linux·运维·服务器
消失的旧时光-19431 小时前
Spring Boot 工程化进阶:统一返回 + 全局异常 + AOP 通用工具包
java·spring boot·后端·aop·自定义注解
NE_STOP1 小时前
Redis--发布订阅命令和Redis事务
java