Summary of basic knowledge points of mobile web--

Source: Internet
Author: User

Viewport viewport

1, mobile device browser (or WebView in the app) is like a frame, viewport is picture frame, if the picture frame as large is not perfect?

2. Shortcut key: META:VP + TAB, use Meta to adjust the viewport to the same size as the device

<name= "Viewport"  content= "Width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0 ">

3. Parameter explanation

Name: The Declaration property is the viewport property The content: property is set to a value of width: wide, generally device width device-widthheight: Height, generally not set to automatically support the large Initial-scale: viewport default zoom ratio The general default setting is 1.0user-scalable: setting whether to support scaling general settings is no, false, 0maximum-scale: Maximum placed value  1.0 Minimum-scale: Minimum placed value 1.0

Mobile-style

1, click the Highlight effect: The default click on the mobile side will be accompanied by a highlight effect, you can turn this effect to transparent 2

A, button, input, Optgroup, select, textarea {    -webkit-tap-highlight-color:rgba (0, 0, 0, 0);}

2, Box mode: Box-sizing set to the main frame, so as to ensure that the size of the box will not change its layout due to changes in the content

Box-sizing:content-box;

3, Input style: Mobile input tag will be accompanied by 3d effect, simple border and outline set to none can not be removed

input {    border:none;    Outline:none;    -webkit-appearance:none;}

4, the minimum maximum width: Considering that the mobile device in the large size of the screen will not be over-scaled loss of clarity, in small size screen will not appear the problem of layout disorder, the value is not fixed, according to the actual situation adjustment

max-width:640px;  /* In the industry, the mobile side of the design is generally used 640px*/min-width:300px;  /* The smallest size in the mobile device now 320px*/

5, structure pseudo-class selector: E is a child element, meaning the relative e of the child element under the parent element of the first few homogeneous elements

E:first-of-type matches the first element in the same type Ee:last-of-type matches the last element in the same type Ee:nth-of-type (n) matches the nth element in the same type E

Summary of basic knowledge points of mobile web--

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.