網站首頁 編程語言 正文
彈性容器(flex-direction)
row:橫向
column:縱向
<view class='flex-container'>
<view class='view-size bg-red'></view>
<view class='view-size bg-green'></view>
<view class='view-size bg-yellow'></view>
</view>
.flex-container{
display: flex;
flex-direction: row;
background-color: lightcyan;
height: 800rpx;
width: 100%;
}
.view-size{
height: 200rpx;
width: 200rpx;
}
.bg-red{
background-color: red;
}
.bg-green{
background-color: green;
}
.bg-yellow{
background-color: yellow;
}
在flex.wxss的.flex-container中加入justify-content: flex-start
左對齊
justify-content: flex-end
右對齊justify-content: center
居中
這里沒有flexjustify-content: space-between
散列效果 貼兩邊justify-content: space-around
平分對齊 不貼兩邊
藍箭頭指向的位置是紅箭頭指向位置的一半align-items: center
這一句是代表主軸方向的垂直居中
這里的主軸是row
原文鏈接:https://blog.csdn.net/weixin_46037227/article/details/110237388
相關推薦
- 2022-10-08 淺談數據庫日期類型字段設計應該如何選擇_MsSql
- 2023-08-01 elementui DateTimePicker組件 限制時間范圍(包含時分秒)
- 2022-05-20 C#隊列的簡單使用_C#教程
- 2022-08-19 注解配置SpringMVC
- 2022-08-10 WPF中圖像處理的方法介紹_C#教程
- 2022-04-07 C#異步編程async/await用法詳解_C#教程
- 2021-12-12 linux縮減XFS分區格式的根目錄_Linux
- 2022-12-28 React+Electron快速創建并打包成桌面應用的實例代碼_React
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支