Mobile-Based Development basics

Source: Internet
Author: User

1. Viewport
Property Description
Width Uses device-independent pixels to represent the desired viewport width. it can be a definite number (such as 240) or preferably a relative value, such as Device-width.
height uses device-independent pixels to represent the desired viewport height.   It can be a definite number (such as 320) or preferably a relative value, such as Device-height.
initial-scale

value 2 Doubles the page size,

You can also use decimal values, such as "1.0".

Minimum-scale Represents the minimum allowable zoom level for a page. A value of 1 indicates that the user cannot shrink the page below the natural size.
Maximum-scale Represents the maximum allowable zoom level for a page. The maximum value is 10.0.
User-scalable The Yes/no property that indicates whether the user is allowed to scale the page.

Common usage:

<name= "Viewport"  content= "width=device-width,minimum-scale=1.0, Maximum-scale=1.0,user-scalable=no ">
2. Media type

Common usage:

<!----<href= "Style.css"  media  = "screen"><!---@media screen{    selector{ Rules}}

In addition, the media type supports not and only keywords

@media only Screens {      selector{rules}  }
3. Media Query

Syntax structure:

1. @media Media type and (CSS property: value)

@media screen and (max-width:240px) {    body{font-size:medium;} }

2. @media Media type and (CSS property: value), Media type and (CSS property: value)

@media Handheld and (min-width:360px), screen and (min-width:480px) {    body{font-size:large;} }
4. Screen (landscape/portrait)
/* Vertical Screen */  {    selector{rules}}/* Horizontal screen */{     Selector{rules}}

Mobile-Based Development basics

Related Article

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.