Mobile-side development

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.