Flex:实例

目的:

代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!--pages/index/index.wxml-->
<view class="container">
  <view class="top">
    <text class="top_left">1</text>
    <view class="top_right">
      <text class="top_right_high">2</text>
      <text class="top_right_low">3</text>
    </view>
  </view>
  <view class="buttom">
    <view class="buttom_left">
      <text class="buttom_left_high">4</text>
      <text class="buttom_left_low">5</text>
    </view>
    <view class="buttom_right">
      <text class="buttom_right_high">6</text>
      <text class="buttom_right_low">7</text>
    </view>
  </view>
</view>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* pages/index/index.wxss */
/* 全局 */
.container{
  display: flex;
  flex-direction: column;
}
/* 上半部 */
.top{
  height: 50vh;
  display: flex;
  flex-direction: row;
}
.top_right{
  display: flex;
  flex-direction: column;
}
.top_left{
  height: 600rpx;
  width: 375rpx;
  background-color: red;
}
.top_right_high{
  height: 300rpx;
  width: 375rpx;
  background-color: gold;
}
.top_right_low{
  height: 300rpx;
  width: 375rpx;
  background-color: blue;
}
/* 下半部 */
.buttom{
  height: 50vh;
  display: flex;
  flex-direction: row;
}
.buttom_right{
  display: flex;
  flex-direction: column;
}
.buttom_left{
  display: flex;
  flex-direction: column;
}
.buttom_right_high{
  height: 300rpx;
  width: 375rpx;
  background-color: lightcoral;
}
.buttom_right_low{
  height: 300rpx;
  width: 375rpx;
  background-color: hotpink;
}
.buttom_left_high{
  height: 300rpx;
  width: 375rpx;
  background-color:  aqua;
}
.buttom_left_low{
  height: 300rpx;
  width: 375rpx;
  background-color: green;
}

作者:Hang Shao

出处:https://www.cnblogs.com/pam-sh/p/12327567.html

版权:本作品采用「知识共享」许可协议进行许可。

声明:欢迎交流! 原文链接 ,如有问题,可邮件(mir_soh@163.com)咨询.

posted @   PamShao  阅读(166)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· .NET10 - 预览版1新功能体验(一)
点击右上角即可分享
微信分享提示
more_horiz
keyboard_arrow_up dark_mode palette
选择主题