(reprint) mobile Web front-end development resource integration

Source: Internet
Author: User

Collection, thanks to the original big: bon~~~

Original link: http://www.ccwebsite.com/development-of-resource-integration-in-mobile-terminal/

----------------------------------

Meta-Article 1. Window width
<meta name= "viewport" content= "width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0, User-scalable=no "/>

Where the width of the width=device-width window is set to the width of the device window, can also be fixed width, for example: width=640 640px width (common);

initial-scale=1.0: Set the zoom ratio to 1.0;

minimum-scale=1.0and maximum-scale=1.0 : Minimum scale and maximum zoom ratio;

user-scalable=no: Prevents users from scaling freely, the user-scalable default value is yes .

Hint: Just that is with all parameters, generally used, there user-scalable=no is no use minimum-scale=1.0 and maximum-scale=1.0 to force the prohibition of scaling.

<meta name= "viewport" content= "Width=device-width,initial-scale=1.0,user-scalable=no"/>
2. Automatic recognition format
<meta name= "format-detection" content= "Telephone=no"/>

contentThe parameters inside: telephone=no is to prohibit the browser to automatically recognize the mobile phone number, email=no is forbidden to automatically recognize the browser email.

3. Full template
<meta name= "viewport" content= "Width=device-width,initial-scale=1.0,user-scalable=no"/><meta name= " Format-detection "content=" Telephone=no "/><meta name=" format-detection "content=" Email=no "/>
CSS Articles
Body {font-family: "Helvetica Neue", Helvetica, Stheiti, Sans-serif;/* use sans serif font */}a, img {-webkit-touch-callout:none;/* ban Stop long Press the link with the picture pop-up menu */}html, body {-webkit-user-select:none;/* Suppresses the selection of text */user-select:none;} Button,input,optgroup,select,textarea {-webkit-appearance:none;/* Remove WebKit default form style */}a,button,input,optgroup, Select,textarea {-webkit-tap-highlight-color:rgba (0,0,0,0);/* Remove the blue outer border and gray translucent background when a, input, and button are clicked */}input::- Webkit-input-placeholder {color: #ccc;/* Modify the Planceholder style of input in WebKit */}input:focus::-webkit-input-placeholder { Color: #f00; /* Modify the Planceholder style of input in the WebKit focus state */}body {-webkit-text-size-adjust:100%!important;/* Disable iOS resizing the font */}input:: -webkit-input-speech-button {display:none;/* Hide Android's voice input button */}
Flex Basics

This assumes that the Flex container is .box , and the child element is .item .

1. Define the container as Flex layout
. Box{display:-webkit-flex;/*webkit*/display:flex;} /* Inline flex*/.box{display:-webkit-inline-flex;/*webkit*/display:inline-flex;}
2. Container style
. Box{flex-direction:row | row-reverse | column | column-reverse;/* spindle direction: Left to Right (default) | Right to left | top to bottom | down to top */FLEX-WRAP:NOWRAP | wra P | wrap-reverse;/*: No Line break (default) | Line Break | Line break and the first line below */flex-flow: <flex-direction> | | <flex-wrap>;/* spindle direction and line break shorthand */justify-content:flex-start | Flex-end | Center | Space-between | space-around;/* Spindle alignment: Left-aligned (default) | Right Alignment | Center Alignment | Justify on both sides | Average Distribution */align-items:flex-start | Flex-end | Center | Baseline | stretch;/* Cross axis alignment: Top aligned (default) | Bottom Alignment | Center Alignment | Align and fill up and down | Text Baseline Alignment */align-content:flex-start | Flex-end | Center | Space-between | Space-around | stretch;/* Multi-spindle alignment: Top aligned (default) | Bottom Alignment | Center Alignment | Align and fill up and down | Up/down average distribution */}
3. Child element Styles
. Item{order: <integer>;/* Sort: The smaller the number, the lower the row, the default is 0*/flex-grow: <number>;/* Default 0 *//* Zoom in: 0 (that is, if there is no space to enlarge, A value of 1 is magnified, 2 is a double of 1, and so on) */flex-shrink: <number>; /* Default 1 *//* Zoom out: defaults to 1 (shrinks if space is low, value 0 does not shrink) */flex-basis: <length> | Auto /* Default auto *//* fixed size: defaults to 0, you can set PX values, or you can set percent size */flex:none | [< ' Flex-grow ' > < ' Flex-shrink ',? | | < ' flex-basis ' >]/*flex-grow, Flex-shrink and flex-basis, default value is 0 1 Auto,*/align-self:auto | Flex-start | Flex-end | Center | Baseline | stretch;/* Individual alignment: Auto (default) | Top Alignment | Bottom Alignment | Center Alignment | Align and fill up and down | Text baseline alignment */}
Tips 1. Customizing the Apple icon

Put a file in the root directory of the Web site apple-touch-icon.png , the Apple device to save the site as a bookmark or desktop shortcut, it will use this file as an icon, file size is suggested: 180pxx180px.

2. Custom Favicon
<link rel= "icon" href= "Favicon.ico" mce_href= "Favicon.ico" type= "Image/x-icon" >
3. Define Browser click Behavior
<a href= "tel:020-10086" > Call: 020-10086</a><a href= "sms:10086" > Send sms to: 10086</a><a href= " Mailto:[email protected] "> Email: [Email protected]</a>
4. Define the upload file type and format
<input type=file accept= "image/*" >

The above file upload box, accept You can limit the type of uploaded files, the parameters image/* are all picture types, click will pop up the gallery, you can also specify the format of the picture, image/png the parameters can be set to limit the image type of PNG; video/* accept You can also set multiple file formats with the syntax of accept="image/gif, image/jpeg" ;

5. Use Box-shadow to change (block) The yellow after the form is automatically filled
Input:-webkit-autofill, Textarea:-webkit-autofill, Select:-webkit-autofill{box-shadow:inset 0 0 0 1000px #fff;}
6. Using CSS to implement ellipsis text truncation
White-space:nowrap;text-overflow:ellipsis;overflow:hidden;
7. Use border to draw a small triangle

The principle is: up and down and around the border docking is actually a bevel, using this feature, make one side of the border transparent, the other side of the desired color and hide on the edge, you can become a small arrow shape.

border-width:10px 10px 10px 0; Left arrow border-color:transparent #fff; border-style:solid;width:0;

Tootip notation:

<!--html--><div class= "box" > Hi! Click on the menu to pay attention to the public number yo ~</div>
/*--css--*/.box{position:relative;padding:0 20px;width:380px;height:80px;border-radius:8px;background: #efefef; font-size:18px;line-height:80px;}. Box:after{position:absolute;top:50%;left: -15px;z-index:1;display:block;margin-top: -15px;width:0;border-color: Transparent #efefef; border-style:solid;border-width:15px 15px 15px 0;content: "";}

  

(reprint) mobile Web front-end development resource integration

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.