Mobile-side development:
First, the device is broadly divided into 4 types: Mobile: <768px
ipad side: 769-991px
PC side: 992-1200px
Oversized screen: >1200px
Responsive layouts: The concept proposed by Ethan Marcotte in May 2010 means that a Web site can be compatible with multiple terminals rather than
Make a specific version for each terminal. This concept was created to address mobile internet browsing.
Advantages: High flexibility in the face of different resolution devices
Can quickly solve multi-device display adaptation problems
Cons: Compatible with a variety of equipment workload, low efficiency
Code is cumbersome, there will be hidden useless elements, loading time extended
In fact, this is a compromise of the design of the solution, many factors affect the best results
To a certain extent, change the original layout structure of the site, there will be user confusion situation
Usage: @media
Example: Mobile phone-side @media screen and (max-width:767px) {}
Flat End @media screen and (min-width:769px) and (max-width:999px) {}
PC-side @media screen and (min-width:1000px) {}
Recommendation: Width setting 100% Adaptive, Web page head, tail height pattern are unchanged, the rest of the adaptive.
Here's a small example:
<! DOCTYPE html>
<meta charset= "UTF-8" >
<meta name= "viewport" content= "Width=device-width, initial-scale=1.0, maximum-scale=1.0, User-scalable=no" >
<title>Title</title>
<!--<link rel= "stylesheet" href= "./css/pc.css" >-->
<!--<link rel= "stylesheet" href= "./css/app.css" >-->
<!--<link rel= "stylesheet" href= "./css/flat. CSS >-->
<style type= "Text/css" >
/*PC End */
@media screen and (min-width:1000px) {
. all{
border:1px solid Goldenrod;
width:100%;
Background-color:blueviolet;
}
. top{
width:100%;
height:100px;
Background-color: #2aabd2;
}
. content{
border:1px solid red;
width:100%;
height:300px;
}
. left{
width:33.33%;
height:100%;
Background-color:darkmagenta;
Float:left;
}
. middle{
width:33.33%;
height:100%;
Background-color:gold;
Float:left;
}
. right{
width:33.33%;
height:100%;
Background-color:greenyellow;
Float:left;
}
. bottom{
width:100%;
height:100px;
Background-color:blue;
}
}
/* Flat End */
@media screen and (min-width:768px) and (max-width:999px) {
. all{
border:1px solid Goldenrod;
width:100%;
Background-color:blueviolet;
}
. top{
width:100%;
height:100px;
Background-color: #2aabd2;
}
. content{
border:1px solid red;
width:100%;
height:300px;
}
. left{
/*width:33.33%;*/
width:50%;
height:100%;
Background-color:darkmagenta;
Float:left;
}
. middle{
/*width:33.33%;*/
width:50%;
height:100%;
Background-color:gold;
Float:left;
}
. right{
/*width:33.33%;*/
/*height:100%;*/
/**/
/*float:left;*/
Display:none;
}
. bottom{
width:100%;
height:100px;
Background-color:blue;
}
}
/* Phone side */
@media screen and (max-width:767px) {
. all{
border:1px solid Goldenrod;
width:100%;
Background-color:blueviolet;
}
. top{
height:100px;
Background-color: #2aabd2;
}
. content{
border:1px solid red;
width:100%;
/*height:300px;*/
}
. left{
/*width:33.33%;*/
width:100%;
/*height:100%;*/
height:50px;
Background-color:darkmagenta;
/*float:left;*/
}
. middle{
/*width:33.33%;*/
width:100%;
/*height:100%;*/
height:50px;
Background-color:gold;
/*float:left;*/
}
. right{
/*width:33.33%;*/
width:100%;
/*height:100%;*/
height:50px;
Background-color:greenyellow;
/*float:left;*/
}
. bottom{
width:100%;
height:100px;
Background-color:blue;
}
}
</style>
<body>
<div class= "All" >
<div class= "Top" >top top </div>
<div class= "Content" >
<div class= "left" >left </div>
<div class= "Middle" >middle Center </div>
<div class= "right" >right </div>
</div>
<div class= "Bottom" >bottom bottom </div>
</div>
</body>
Mobile-side development