当前位置:网站首页>[wechat applet] flex layout usage record
[wechat applet] flex layout usage record
2022-04-23 13:06:00 【Many Immortals】
Test code :
1、xml:
<view class="A">
<view class="AA">AA</view>
<view class="AB">AB</view>
<view class="AC">AC</view>
</view>
2、wxss:
.A{
/**/
display: flex;/* Line up by default */
/*flex-direction: column;/* Arrange the direction :row( Transverse forward ) | row-reverse( back ) | column( Vertical positive ) | column-reverse*/
/*flex-wrap: nowrap;/* If it's a line : How to wrap :nowrap( Don't wrap , Default ) | wrap( positive ) | wrap-reverse( reverse )*/
/*flex-flow: row nowrap;/* Abbreviations of the above two forms */
justify-content: space-around;/* What's in it ( level ): Align left start,end Right alignment ,center In the middle , One line only takes effect ( The transverse ):between Both ends are aligned at equal intervals ,around:...*/
align-items: flex-start;/* vertical : Align left flex-start,..end Right alignment ,..center In the middle ,baseline , stretch*//**//**//**/
/*align-content:flex-end ;/* Multiple axes work */
width: 100%;
height: 100%;
background-color: rgb(223, 226, 210);
}
.AA{
width: 10%;
height: 20%;
background-color: rgb(136, 20, 20);
}
.AB{
width: 20%;
height: 20%;
background-color: rgb(52, 150, 69);
}
.AC{
width: 40%;
height: 20%;
background-color: dodgerblue;
}
3、 test result :
Everything else is easy to say , Let's focus on justify-content Two kinds of properties ( One line works ):
(1)space-around: Uniform distribution , Keep both ends
flex-direction: column;
justify-content: space-around;
When two attributes are written at the same time , Just play the first role , Because the second is invalid on multiple lines :
So the second line is whether to write , It's all like this :

If you change it to horizontal arrangement (1 That's ok ):( Evenly arranged and distributed )
flex-direction: row;
justify-content: space-around;

(2)space-between: Uniform distribution , Leave no ends
Empathy , If it is multiple lines , It doesn't work .
If it's a line :

in addition , When I test flex-end and center when , It is also invalid for multiple lines , One line is valid .
If you want these two attributes of multiple lines to take effect :
4、 summary :
The following is a list of common situations :
(1) The arrangement of a row :
- 1、 Element order post :
display: flex;/* Line up by default */
flex-direction: row;
justify-content: flex-end;

- 2、 Elements are placed in reverse order :
display: flex;/* Line up by default */
flex-direction: row-reverse;

- 3、 Compact Center :
display: flex;/* Line up by default */
flex-direction: row;
justify-content: center;

- 4、 Evenly distributed :
justify-content:space-between:

justify-content::around: Keep the beginning and end

- Center lines : align-items:center ; Multiline postposition :align-items:flex-end ;


版权声明
本文为[Many Immortals]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231301011394.html
边栏推荐
- (personal) sorting out system vulnerabilities after recent project development
- Design and manufacture of 51 single chip microcomputer solar charging treasure with low voltage alarm (complete code data)
- [Technical Specification]: how to write technical documents?
- mysql 基本语句查询
- mysql8安装
- Navicat远程连接数据库 出现 1130- Host xxx is not allowed to connect to this MySQL server错误
- Important knowledge of transport layer (interview, retest, final)
- HQL statement tuning
- AUTOSAR from introduction to mastery 100 lectures (81) - FIM of AUTOSAR Foundation
- Go language mapping operation
猜你喜欢

GIS practical tips (III) - how to add legend in CASS?

Read the data in Presto through sparksql and save it to Clickhouse

【微信小程序】flex布局使用记录

World Book Day: I'd like to recommend these books

100 GIS practical application cases (53) - making three-dimensional image map as the base map of urban spatial pattern analysis

nodeJs + websocket 循环小案例

Free and open source intelligent charging pile SaaS cloud platform of Internet of things

Important knowledge of network layer (interview, reexamination, term end)

MySQL -- 16. Data structure of index

Synchronously update the newly added and edited data to the list
随机推荐
100 GIS practical application cases (34) - splicing 2020globeland30
Go language mapping operation
Connect orcale
jmeter操作redis
CMSIS cm3 source code annotation
Design of body fat detection system based on 51 single chip microcomputer (51 + OLED + hx711 + US100)
AUTOSAR from introduction to mastery 100 lectures (52) - diagnosis and communication management function unit
【微信小程序】flex布局使用记录
uniapp image 引入本地图片不显示
Async void caused the program to crash
PC starts multiple wechat at one time
Free and open source intelligent charging pile SaaS cloud platform of Internet of things
HQL statement tuning
Recovering data with MySQL binlog
Record Alibaba cloud server mining program processing
Servlet监听器&过滤器介绍
8086 of x86 architecture
Mysql8 installation
22. 括号生成
100 GIS practical application cases (52) - how to keep the number of rows and columns consistent and aligned when cutting grids with grids in ArcGIS?

