当前位置:网站首页>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 .
边栏推荐
- 服务器硬件及RAID配置实战
- Jenkins automated unattended operation (up / down)
- Flink function (1): rich function
- Use intranet penetration to realize public network access to the Intranet
- Jenkins自动化无人值守运行(上/下)
- NTP error: no server suitable for synchronization found
- go的环境搭建和起步
- leetcode剑指offer JZ25 合并两个排序的链表
- go语言常用命令和包管理
- Crud of MySQL
猜你喜欢

剑指offer JZ10斐波那契数列

Do not rent servers, build your own personal business website (3)

Heap overflow of kernel PWN basic tutorial

Polkadot | interprets how liberty plan, which subverts traditional social media, will be launched in Poka

一批面试题及答案_20180403最新整理

IP course (OSPF) comprehensive experiment

Tensorflow GPU installation -- 056

Simple three-step fast intranet penetration

Set up a WordPress personal blog locally and launch it through the intranet (22)

【301】怪诞行为学-可预测的非理性
随机推荐
General paging 2.0
How to build a website full of ritual sense and publish it on the public website 2-2
awk的使用
SSH远程访问及控制
IP course (OSPF) comprehensive experiment
Quickly and simply set up FTP server, and achieve public network access through intranet [no need for public IP]
Flink time stream processing
Pycharm set code template
JSP tag
三分钟记住20道性能测试经典面试题
mysql 忘记退出直接关闭窗口现在要删除整个文件夹如何删除
Leetcode sword finger offer jz42 maximum sum of continuous subarrays
Flink state use
LuckyFrameWeb测试平台(一款支持接口自动化、WEB UI自动化、APP自动化,并且支持分布式测试的全纬度免费开源测试平台)
Dameng database_ Small matters needing attention during use
进行挂载永久挂载后无法开机
[no need for public IP] configure a fixed public TCP port address for remote desktop raspberry pie
MySQL from basic to entry to high availability
Unable to boot after permanent mounting
RAID5和LVM组合使用