Mobile web--Media Query

Source: Internet
Author: User

Basic concepts

Responsive development in the absence of media queries, can also be achieved through JS, but people do not consider, especially cumbersome. In the presence of media queries, it is only beginning to gradually promote the response style. In the actual development, in time and money sufficient situation still do not do response, affect performance, maintenance trouble.

Basic use

1, the screen is greater than or equal to 480px, using parentheses in the

<!DOCTYPE HTML><HTMLLang= "en"><Head>    <MetaCharSet= "UTF-8">    <title>Title</title>    <style>@media screen and (min-width:480px){Body {Background-color:Black;            }        }    </style></Head><Body></Body></HTML>

2, the screen is less than or equal to 1000px, using parentheses in the

<!DOCTYPE HTML><HTMLLang= "en"><Head>    <MetaCharSet= "UTF-8">    <title>Title</title>    <style>@media screen and (max-width:1000px){Body {Background-color:Black;            }        }    </style></Head><Body></Body></HTML>
<!DOCTYPE HTML><HTMLLang= "en"><Head>    <MetaCharSet= "UTF-8">    <title>Title</title>    <style>@media screen and (max-width:1000px){. header{Display:None;            }}. Header{width:100%;Height:50px;Border:1px solid #304115;        }    </style></Head><Body><Divclass= "header"></Div></Body></HTML>

Mobile web--Media Query

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.