当前位置:网站首页>Wechat applet development reserve knowledge
Wechat applet development reserve knowledge
2022-06-29 17:52:00 【Aricl.】
Catalog
Two 、 Mobile terminal related knowledge
(2) Device independent pixel &css Pixels
One 、Flex Layout
(1) brief introduction
1) Flex yes Flexible Box Abbreviation , Meaning for ” Elastic layout ”, To provide maximum flexibility for box models .2) Any container can be specified as Flex Layout , Inline elements can also be used Flex Layout .3) Be careful , Set to Flex After the layout , The child element float、clear and vertical-align Property will fail .4) use Flex Elements of layout , be called Flex Containers (flex container), abbreviation ” Containers ”. All its child elements automatically become container members , be called Flex project (flex item), abbreviation ” project ”

The container has two axes by default : Horizontal spindle (main axis) And the vertical cross axis (cross axis).
Starting position of spindle ( The intersection with the border ) be called main start, The ending position is called main end.
The starting position of the cross axis is called cross start, The ending position is called cross end, Items are arranged along the main axis by default .
The spindle space occupied by a single project is called main size, The cross axis space occupied is called cross size.
(2) attribute
flex-direction
flex-wrap
flex-flow
justify-content
align-items
align-content
Flex Layout Specific Learning Websites :Flex Layout grammar tutorial | Novice tutorial
Two 、 Mobile terminal related knowledge
(1) Physical pixel
The resolution of the screen , The smallest unit that the device can control the display , Physical pixels can be regarded as corresponding pixels
(2) Device independent pixel &css Pixels
Device independent pixel ( Also called density independent pixels ), It can be considered as a point in the computer coordinate system , This point generationTable a virtual pixel that can be used and controlled by a program ( such as :CSS Pixels , It's just android In flight CSS Pixel onDon't cry ”CSS Pixels ” Instead of calling ” Device independent pixel ”), And then it's transformed into physical pixels by related systems .
(3)dpr Than &DPI&PPI
1) dpr: Device pixel ratio , Physical pixel / Device independent pixel = dpr, General with Iphon6 Of dpr Subject to dpr = 22) PPI: Number of pixels on one inch display3) DPI: At first, it refers to the number of ink points printed by the printer per unit area , The more ink dots, the clearer



(4) Mobile adaptation scheme
1)viewport adapter
reason :
a) When mobile phone manufacturers produce mobile phones, the default page width of most mobile phones is 980pxb) The actual viewport width of the mobile phone should be less than 980px, Such as : iphone6 by 375pxc) Development requirements : Need to put 980 The page is completely displayed on the phone screen without scroll bars

Implementation code :
<meta name="viewport" content="width=device-width,initial-scale=1.0">2)rem adapter
reason :
a) Too many models , Different models have different screen sizesb) demand : The content of a set of design draft has the same effect on different models , Depending on the screen size , The content of the page changes accordingly
function remRefresh() {
let clientWidth = document.documentElement.clientWidth; // Divide the screen equally 10 Share
let rem = clientWidth / 10;
document.documentElement.style.fontSize = rem + 'px';
document.body.style.fontSize = '12px'; }
window.addEventListener('pageshow', () => {
remRefresh()
})
// Function anti shake
let timeoutId;
window.addEventListener('resize', () => {
timeoutId && clearTimeout(timeoutId);
timeoutId = setTimeout(() =>{
remRefresh()
}, 300)
})Record the learning process of wechat applet development , Welcome to study and exchange !
边栏推荐
- Let's start with a bug that was cheated by the app store
- [网鼎杯 2020 青龙组]AreUSerialz
- 面试中问最常问的海量数据处理你拿捏了没?
- Parental delegation mechanism
- 基于gis三维可视化的智慧城市行业运用
- [try to hack] cookies and sessions
- mysql. What is the concept of sock
- Visual studio plug-in coderush officially released v22.1 -- visual tool for optimizing debugging
- 回文子串的最大长度(字符串哈希+二分)
- 【WebDriver】使用AutoIt上传文件
猜你喜欢

Premature end of script headers 或 End of script output before headers

How to create a virtual image

Have you grasped the most frequently asked question in the interview about massive data processing?

Top 30 open source software

VB. Net read / write NFC ntag tag source code

让 Google 搜索到自己的博客

牛客小Bai月赛52 D 环上食虫(尺取+st表)

What is the MySQL query view command

Basic operations such as MySQL startup under Windows platform

MATLAB 最远点采样(FPS)
随机推荐
基于注解和拦截器防止表单重复提交
Selenium key combination operation
Partial mock of static class of phpunit operation
Redux源码分析之createStore
Can MySQL views create indexes
Industry application of smart city based on GIS 3D visualization
双亲委派机制
Top 30 open source software
Issue 42: is it necessary for MySQL to have multiple column partitions
Repair of JSON parsing errors in a collection
Split palindrome string [dp + DFS combination]
一次采集JSON解析错误的修复
SCM系统是什么?供应链管理系统有哪些优势?
金鱼哥RHCA回忆录:DO447构建高级作业工作流--创建作业模板调查以设置工作的变量
MATLAB 最远点采样(FPS)
reflex
How to use the chart control of the b/s development tool devextreme - customize the axis position?
牛客小Bai月赛52 D 环上食虫(尺取+st表)
Matlab farthest point sampling (FPS)
[网鼎杯 2020 青龙组]AreUSerialz