当前位置:网站首页>Responsive layout
Responsive layout
2022-06-30 05:15:00 【-iLu】
Response type
Let a website adapt to multiple devices or screens , It can make the layout and functions of the website change with the user's use environment .
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@media Media query : Set different types of media query criteria , Call the appropriate style for the eligible media ,IE8 The following is not supported
for example :meidia all and (max-width:400px){} [ Note blank space ]
Media type :all: All devices
screen: Computer screen , Flat , mobile phone
print: The printer
Device resolution
The computer :1000-1200
Flat :768-992 992-1200
meidia all and (min-width:992px){}
mobile phone :768
meidia all and (max-width:768px){}
for example :@media all and (max-width:992px){ // Flat side
.box{background-color: blue;}
}
@media all and (max-width:768px){ // Mobile terminal
.box{background-color: green;}
}
Device keywords
all All devices screen Display device handled Portable devices ( Desktop computers are not included ) aural Auditory equipment braille Braille tactile device
pro jecttion Projection equipment tty typewriter / terminal embossed Braille device 【all The position of can be filled with 】
Be careful :
【and There must be a space before and after the connection 】
Import the file as a response
<link rel="stylesheet" href="../media.css" media="all and (max-width:992px)">
Device responsive labels
<meta name="viewport" content="width=device-width, initial-scale=1.0">
name="viewport" Equipment mobile terminal equipment
width=device-width Adaptive devices
initial-scale=1.0 Initial scaling
minimum-scale=0.5 Minimum zoom value
maximum-scale=1.5 Maximum zoom value
user-scalable=yes/no Allow zoom or not
Responsive considerations
1. Must write device response labels , Otherwise, the mobile terminal will not recognize the response type
2.media The document says 992 and 768 Pixels are OK
3. Most layouts use percentages to set width and height No need to zoom in or out to set fixed pixels
4. Spacing value , The up and down distances can be fixed pixels , The left and right distance should be set as a percentage
5. Use css3 Instead of floating elements
6. In addition to the menu at the head , To reduce the use of fixed positioning ( Positioning causes serialization ) Relative sets in pages are absolutely allowed
7. Text zooms in and out using em and rem
8. Pictures or div For zooming in and out zoom and transform
9. The picture adapts to the resolution img{width:100%;height:auto }
边栏推荐
- Unity download and installation website
- [recruitment] UE4 Development Engineer
- Unity3d packaging and publishing APK process
- Unity supports the platform # define instruction of script
- Passing values between classes using delegates and events
- Generate a slice of mesh Foundation
- [typescript] cannot redeclare block range variables
- Unity3d learning notes-1 (C # learning)
- Unit asynchronous jump progress
- Unity scroll view element drag and drop to automatically adsorb centering and card effect
猜你喜欢
![[learning notes] AssetBundle, xlua, hot update (use steps)](/img/59/9d9f31cfe55a908f2f0705e95ecc05.jpg)
[learning notes] AssetBundle, xlua, hot update (use steps)

Intellj idea generates jar packages for projects containing external lib to other projects. The method refers to the jar package written by itself

Force buckle 59 Spiral matrix II

中文版PyCharm改为英文版PyCharm

Ripple effect of mouse click (unity & shader)

Generate a slice of mesh Foundation

Virtual and pure virtual destructions

VFPBS在IIS下调用EXCEL遇到的Access is denied

Unity shader flat shadow

Summary of common loss functions in pytorch
随机推荐
PWN入门(2)栈溢出基础
How to install win7 on AMD Ruilong CPU A320 series motherboard
Initial environment configuration of the list of OpenGL super classic (version 7) vs2019
Unity3d position the model, rotate, drag and zoom around the model to obtain the center point of the model
Writing unityshader with sublimetext
Force buckle 704 Binary search
[typescript] defines the return value type of promise
amd锐龙CPU A320系列主板如何安装win7
【VCS+Verdi联合仿真】~ 以计数器为例
[notes] unity Scrollview button page turning
pycharm 数据库工具
ParticleSystem in the official Manual of unity_ Collision module
Solution to 293 problems in the week of Li Kou
The file has been downloaded incorrectly!
Solution to Autowired annotation warning
【VCS+Verdi聯合仿真】~ 以計數器為例
Harbor API 2.0 query
力扣(LeetCode)180. 连续出现的数字(2022.06.29)
Unity Catmull ROM curve
Chapter 8 primitive processing of OpenGL super classic (version 7)