当前位置:网站首页>Mobile web training day-1
Mobile web training day-1
2022-06-28 13:06:00 【HHppGo】
1. Characteristics of mobile terminal
1.1 Mobile and PC There are some differences between end pages
- Different sizes :
- PC The screen Big , Mobile terminal screen Small
- Different content locations :
- PC The end content is in Forum
- The mobile terminal is full of content , Of the screen width 100%
- summary :
- By comparing the differences , We realized that , Different mobile terminals , Different screen widths
- Need to do in the future Mobile Web Page adaptation ( The core )

1.2 Google simulator
- effect : It can easily simulate different mobile devices , Conduct code and effect debugging
1.3 The resolution of the
I.e. number of pixel cells 
Why understand device resolution ?
- Different devices have different resolutions , In order to know what resolution to write code for future development , Need to know the resolution
Screen size :
- The screen Diagonal distance , In inches
Screen resolution :
- Physical resolution
- Factory resolution of the equipment , At the hardware level , Can't change
- Logical resolution
- Zoom the resolution through the driver of the system , You can modify
- When developing , Refer to that resolution ?
- Logical resolution
- Physical resolution
1.4 viewport
Concept :
- The visual area of a web page

- The visual area of a web page
In development , The width of the web page should be consistent with the logical pixel width of the device , How to achieve ?
<head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Viewport label : Make sure the page width is the same as the logical pixels of the device --> <!-- name="viewport" Express viewport , Visual area of the page --> <!-- content="width=device-width Express The width of the visible area of the page is the width of the device ( Logical pixel width ) --> <!-- initial-scale=1.0" Represents the zoom ratio of the resolution ,1.0 == 100%, Don't zoom --> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title> Test viewport width </title> </head>
1.5 Double
Why should a designer design a double ?
- Make sure that pictures are placed on different screens , It won't blur
Front end developers , Which resolution does the code refer to ?
- Logical resolution ( The corresponding graph is a one fold graph )
2. Percentage layout ( understand )
effect :
Width adaptation , Fixed height
The width is adaptive in percentage
.toolbar li { float: left; /* Percentage layout : Width adaptation Let five li label , Every li The tag occupies one fifth of the parent 20% */ width: 20%; /* Percentage layout : Fixed height */ height: 50px; }
3. Flex Layout
3.1 Part of the

- effect :
- be based on Flex Accurately and flexibly control the layout of block level boxes , Avoid separation from document flow in floating layout .
- Flex Layout Very suitable for structured layout
- Setting mode :
- The parent element adds display: flex;
- Part of the :
- Elastic container
- Elastic box
- Spindle
- Side axle
3.2 Spindle alignment
/* flex Layout */
display: flex;
/* Adjust the horizontal spacing */
/* The default value is , From left to right , No spacing */
justify-content: flex-start;
/* The default value is , From right to left , No spacing */
justify-content: flex-end;
/* Center along the main axis , No spacing */
justify-content: center;
/* In the direction of the spindle , Each box has the same left-right spacing */
justify-content: space-around;
/* In the direction of the spindle , The leftmost and rightmost boxes are close to the left and right of the parent , Space draw allocated to other boxes */
justify-content: space-between;
/* In the direction of the spindle , Each elastic box has the same spacing */
justify-content: space-evenly;
effect :
justify-content: center;Center along the main axis , No spacing
justify-content: space-around;In the direction of the spindle , Each box has the same left-right spacing
justify-content: space-between;In the direction of the spindle , The leftmost and rightmost boxes are close to the left and right of the parent , Space draw allocated to other boxes
justify-content: space-evenly;In the direction of the spindle , Each elastic box has the same spacing
边栏推荐
- 腾讯确认QQ大规模盗号,iPhone14无缘Type-C,第四大运营商5G正式放号,今日更多大新闻在此...
- async-validator.js數據校驗器
- 移动Web实训DAY-1
- SHAREit实力出众,登陆全球 IAP 实力榜 Top7
- align-items 与 align-content 的区别
- Centos7 - installing mysql5.7
- Understand leveldb write operation
- ASP. NET CORE Study11
- You must configure either the server or JDBC driver (via the ‘serverTimezone‘ configuration property
- pytorch主要模块
猜你喜欢

Evaluation of IP location query interface I

一文搞懂leveldb写操作

Stm32f1 and stm32cubeide programming example - matrix keyboard driver

【MySQL从入门到精通】【高级篇】(三)MySQL用户的创建_修改_删除以及密码的设置

Tencent tangdaosheng: facing the new world of digital and real integration, developers are the most important "architects"

Understand leveldb write operation
JS class is not just a simple syntax sugar!

嵌入式开发:估算电池寿命的7个技巧

高考失利進哈工大,畢業卻留校要當“探索者”,丁效:科研就是厚積薄發

Oceanwide micro fh511 single chip microcomputer IC scheme small household appliances LED lighting MCU screen printing fh511
随机推荐
fastposter v2.8.4 发布 电商海报生成器
pytorch基础
Manjaro easyconnecy error: libgtk-x11-2.0 so. 0: cannot open shared object file: No such file or directory
BUUCTF:[WUSTCTF2020]朴实无华
弹性盒子自动换行小Demo
Continuous integration practice of Baidu app based on pipeline as code
【历史上的今天】6 月 28 日:马斯克诞生;微软推出 Office 365;蔡氏电路的发明者出生
Buuctf:[wustctf2020] plain
Vscode如何设置代码保存后自动格式化
Oceanwide micro fh511 single chip microcomputer IC scheme small household appliances LED lighting MCU screen printing fh511
从 jsonpath 和 xpath 到 SPL
Validateur async. Vérificateur de données JS
How does Quanzhi v853 chip switch sensors on Tina v85x platform?
Fastposter v2.8.4 release e-commerce poster generator
数字孪生能源系统,打造低碳时代“透视”眼
求职简历的书写技巧
plt.savefig()的用法以及保存路径
移动Web实训DAY-2
微服务稳定性保障
JS class 并不只是简单的语法糖!



