当前位置:网站首页>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 .
边栏推荐
- Pyinstaller's method of packaging pictures attached to exe
- Conditions and solutions of deadlock
- 全是精华的模电专题复习资料:基本放大电路知识点
- [2. Basics of Delphi grammar] 3 Object Pascal constants and variables
- Experiment collection of University "Fundamentals of circuit analysis". Experiment 7 - Research on sinusoidal steady-state circuit
- 数字藏品系统开发(程序开发)丨数字藏品3D建模经济模式系统开发源码
- 《大学“电路分析基础”课程实验合集.实验六》丨典型信号的观察与测量
- 6092. Replace elements in the array
- Huawei ECS installs mysqlb for mysqld service failed because the control process exited with error code. See “sys
- Experiment collection of University "Fundamentals of circuit analysis". Experiment 6 - observation and measurement of typical signals
猜你喜欢
idea 公共方法抽取快捷键
愛可可AI前沿推介(7.2)
Recommended practice sharing of Zhilian recruitment based on Nebula graph
Huawei ECS installs mysqlb for mysqld service failed because the control process exited with error code. See “sys
Xpt2046 four wire resistive touch screen
Pattern matching extraction of specific subgraphs in graphx graph Computing Practice
Experiment collection of University Course "Fundamentals of circuit analysis". Experiment 5 - Research on equivalent circuit of linear active two terminal network
【5G NR】RRC连接释放
After the win10 system is upgraded for a period of time, the memory occupation is too high
The outline dimension function application of small motherboard
随机推荐
Add an empty column to spark dataframe - add an empty column to spark dataframe
(5) Flink's table API and SQL update mode and Kafka connector case
Ant group's large-scale map computing system tugraph passed the national evaluation
Introduction to database system Chapter 1 short answer questions - how was the final exam?
/Bin/ld: cannot find -llz4
Invalid bound statement (not found)解决方法总结
What are the necessary functions of short video app development?
可视化技术在 Nebula Graph 中的应用
Practice of constructing ten billion relationship knowledge map based on Nebula graph
idea jar包冲突排查
注册成为harmonyos开发者并安装DevEco Studio 3.0 Beta2 for HarmonyOS
The sea of stars hidden behind the nebula graph
图数据库|Nebula Graph v3.1.0 性能报告
【小白聊云】中小企业容器化改造建议
Boot 连接 Impala数据库
爱可可AI前沿推介(7.2)
基于 Nebula Graph 构建百亿关系知识图谱实践
Aiko ai Frontier promotion (7.2)
fastjson List转JSONArray以及JSONArray转List「建议收藏」
Experiment collection of University Course "Fundamentals of circuit analysis". Experiment 5 - Research on equivalent circuit of linear active two terminal network