当前位置:网站首页>Responsive page
Responsive page
2022-07-24 06:30:00 【PS notes】
The same set of static page code , Show different effects in different devices , And it can adapt
Monitor terminal equipment .
Media query
adopt @media Definition of style , The browser window meets the specified conditions , Will Yin use this style .
.box{
width:200px;
height:200px;
background-color:red;
}
Less than the specified width , Style works
@media screen and (max-width:600px){
background-color:blue;
}
</head>
<style>
.box{
width: 100px;
height: 100px;
background-color: yellow;
}
@media screen and (max-width:600px) {
.box{
width: 200px;
height: 200px;
background-color: red;
}
}
</style>
<body>
<div class="box"></div>
</body>
</html>
You can also set multiple conditions :
@media screen and (min - width:600px ) and (max-width:900px){
.box{
background-color:blue;
}
}
</head>
<style>
.box{
width: 100px;
height: 100px;
background-color: yellow;
}
@media screen and (min-width: 600px) and (max-width: 900px) {
.box{
width: 200px;
height: 200px;
background-color: red;
}
}
</style>
<body>
<div class="box"></div>
</body>
</html>Make a case :
<style>
.container{
display: flex;
width: 800px;
margin:0 auto;
background-color: #eee;
justify-content: center;
}
.item{
width: 200px;
border: 1px solid red;
}
@media screen and ( max-width: 700px) {
.container {
width: 100%;
flex-direction:column;
}
}
.item{
width: 100%;
}
</style>
<body>
<div class="container">
<div class="item">
<h1> file </h1>
</div>
<div class="item">
<h1> Blog </h1>
</div>
<div class="item">
<h1> video </h1>
</div>
</div>
</body>
</html>

Advantages and disadvantages of responsive pages
advantage : A set of pages is suitable for multi terminal devices , Improve development efficiency
shortcoming : The page effect is not the page effect of one end alone , Performance issues , Maintenance costs are high
summary : Most projects will not have a responsive solution as a whole .
边栏推荐
- [award issuance] the results of the first essay solicitation activity in oneos zone were announced
- rsync(一):基本命令和用法
- IP作业(2)RIP
- Do not rent servers, build your own personal business website (1)
- openssl版本升级
- [219] what is the difference between app testing and web testing?
- JSP tag
- IA课总结(2)
- UE4 reload system 1. basic principle of reload system
- Unity (III) three dimensional mathematics and coordinate system
猜你喜欢

Flink production environment configuration recommendations

UE4 reload system 1. basic principle of reload system

Custom MVC 2.0

手动安装Apache
![Remote connection to Qunhui NAS at home [no public IP, free intranet penetration]](/img/bf/cda5a28f0aabb28b2fc56a79480347.png)
Remote connection to Qunhui NAS at home [no public IP, free intranet penetration]

MySQL Index & execution plan

Use intranet penetration to realize public network access to the Intranet

Li Kou 986. Intersection of interval lists

IA课总结(2)

力扣986.区间列表的交集
随机推荐
服务器硬件及RAID配置实战
【214】什么是自动化框架
leetcode 不用加减乘除算加法 || 二进制中1的个数
Playing RTSP video stream on webpage
leetcode剑指offer JZ25 合并两个排序的链表
JSP tag
MySQL从基础到入门到高可用
一个测试经理/测试主管/测试总监的工作总结
Leetcode剑指offer JZ9 双栈实现队列
Jenkins automated unattended operation (up / down)
[219] what is the difference between app testing and web testing?
Quickly and simply set up FTP server, and achieve public network access through intranet [no need for public IP]
Ia class summary (2)
Customize MVC 3.0
ip作业(1)
XML parsing
Flink production environment configuration recommendations
awk的使用
微信TBS在线安装内核失败的解决方法
Leetcode sword finger offer jz42 maximum sum of continuous subarrays