当前位置:网站首页>Mobile web development learning notes - Layout
Mobile web development learning notes - Layout
2022-07-02 16:01:00 【Dumb monkey】
1. Make mobile page separately ( Main stream )
Fluid layout ( Percentage layout )
flex Elastic layout ( Strongly recommend )
less+ rem+ Media query layout
Mixed layout
2. Responsive pages are compatible with mobile terminals ( secondly )
Media query
· bootstarp
Common layout of mobile terminal
Fluid layout ( Percentage layout )
Fluid layout , It's the percentage layout , Also known as unfixed pixel layout .
adopt The width of the box is set as a percentage To scale according to the width of the screen , Not limited by fixed pixels , The content is padded on both sides .
max-width Maximum width ( max-height Maximum height )
min-width Minimum width ( min-height Minimum height )
Double sprite drawing practice
stay firework Inside, scale the sprite map to half of the original , Then measure the coordinates according to the size , Pay attention to the code background-size Also write : Half the original width of the sprite map
flex Elastic layout
Layout principle
flex yes flexible Box Abbreviation , by " Elastic layout " , Used to provide maximum flexibility for shape models , Any container can
Designated as flex Layout .
When we set the parent box to flex After the layout , Elemental float、clear and vertical-align Property will fail .
Telescoping layout = Elastic layout = Expansion box layout = Elastic box layout =flex Layout
summary flex Layout principle :
It is through Add to parent box flex attribute , To control the position and arrangement of sub boxes
Common parent properties
flex-direction : Set the direction of the spindle
justify-content : Set the arrangement of sub elements on the spindle
flex-wrap : Set whether the child element should wrap
align-content : Set the arrangement of the child elements on the side axis ( Multiple lines )
align-items : Set the arrangement of sub elements on the side axis ( A single )
flex-flow : Compound attribute , It's equivalent to setting flex- direction and flex-wrap
flex-direction Set the direction of the spindle
Main shaft and side shaft
stay flex Layout , It is divided into two directions: the main shaft and the side shaft , The same name is : Row and column 、x Axis and y Axis
The default spindle direction is x Axis direction , Horizontal right
The default side axis direction is y Axis direction , Horizontal down

Property value
flex- direction Property determines the direction of the spindle ( That is, the arrangement direction of the project )
Be careful : The main shaft and the side shaft change , Just look flex-direction Who is the spindle set to , The rest is the side shaft . And ours The sub elements are arranged along the main axis Of .

justify-content Set the arrangement of sub elements on the spindle
Be careful : Before using this property, be sure to determine which spindle is .

flex-wrap Set whether the child element should wrap
By default , The projects are all in one line ( also called ” axis ”). On .flex-wrap Attribute definitions , flex The default in layout is no line break Of .

align-items Set side axis . The arrangement of the sub elements on the ( A single )

align-content Set the arrangement of the child elements on the side axis ( Multiple lines )
Set the arrangement of children on the side axis and can only be used for the appearance of children Line breaks ( Multiple lines ) , It doesn't work in a single line .

flex-flow
flex-flow The attribute is flex-direction and flex-wrap Composite properties of properties
flex-flow: row wrap;Common sub item properties
flex attribute
flex Property defines the remaining space allocated by the subproject , use flex To show how much Additional copies .
.item {
flex:<number>; /* default 0*/
}align-self Controls how the subitems themselves are arranged on the side axis
align-self Property allows a single item to be squeezed differently from other items , covering align-items attribute .
The default value is auto , Represents the... That inherits the parent element align-items attribute , If there is no element , Is equivalent to stretch.
order Property defines the order in which items are arranged
The smaller the numerical , The further up the line , The default is 0.
Be careful : and z-index Dissimilarity .
边栏推荐
- Idea public method extraction shortcut key
- Pattern matching extraction of specific subgraphs in graphx graph Computing Practice
- 处理gzip: stdin: not in gzip formattar: Child returned status 1tar: Error is not recoverable: exitin
- The sea of stars hidden behind the nebula graph
- Traversal before, during and after binary tree
- SQL FOREIGN KEY
- Pyinstaller's method of packaging pictures attached to exe
- 多数据源配置代码
- 《大学“电路分析基础”课程实验合集.实验七》丨正弦稳态电路的研究
- (5) Flink's table API and SQL update mode and Kafka connector case
猜你喜欢

After the win10 system is upgraded for a period of time, the memory occupation is too high

Experiment collection of University Course "Fundamentals of circuit analysis". Experiment 5 - Research on equivalent circuit of linear active two terminal network

手机app通达信添加自定义公式(分时T+0)为例子讲解

Add user-defined formula (time sharing t+0) to mobile app access as an example

Traversal before, during and after binary tree

Postgressql stream replication active / standby switchover primary database no read / write downtime scenario

Idea jar package conflict troubleshooting

如何實現十億級離線 CSV 導入 Nebula Graph

idea jar包冲突排查

Why does the system convert the temp environment variable to a short file name?
随机推荐
/bin/ld: 找不到 -lxml2
Experiment collection of University "Fundamentals of circuit analysis". Experiment 7 - Research on sinusoidal steady-state circuit
idea 公共方法抽取快捷键
《大学“电路分析基础”课程实验合集.实验七》丨正弦稳态电路的研究
Invalid bound statement (not found) solution summary
愛可可AI前沿推介(7.2)
Fiddler realizes mobile packet capturing - getting started
[development environment] install Visual Studio Ultimate 2013 development environment (download software | install software | run software)
全方位解读服务网格(Service Mesh)的背景和概念
/Bin/ld: cannot find -lxslt
【小白聊云】中小企业容器化改造建议
Soul torture, what is AQS???
Experiment collection of University "Fundamentals of circuit analysis". Experiment 4 - Research on linear circuit characteristics
Storage, reading and writing of blood relationship data of Nepal Graph & Data Warehouse
Boot connection to impala database
PyObject 转 char* (string)
目标检测—利用labelimg制作自己的深度学习目标检测数据集
SQL FOREIGN KEY
6092. Replace elements in the array
XPT2046 四线电阻式触摸屏