Overview of Mobile Web Development Specifications

Overview of Mobile Web Development Specifications

[[140706]]

The following specifications and suggestions are all the experience summarized and refined by Alloyteam in the daily development process. The specifications have good project practices and are strongly recommended for use.

Font Settings

Use sans serif fonts

  1. body {
  2. font-family: "Helvetica Neue" , ​​Helvetica, STHeiTi, sans-serif;
  3. }

iOS 4.0+ uses the English font Helvetica Neue, and previous iOS versions are downgraded to Helvetica. The Chinese font is set to Huawen Bold STHeiTi. It should be noted that Huawen Bold does not exist in the iOS font library (http://support.apple.com/kb/HT5878), but the system will automatically make Huawen Bold STHeiTi compatible*** The system default Chinese font is Bold-Simplified or Bold-Traditional

  1. Heiti SC Light Bold-Simplified Thin ( discarded after iOS 7 )
  2. Heiti SC Medium Bold-Simplified Medium Black
  3. Heiti TC Light Bold-Traditional Thin
  4. Heiti TC Medium Bold-Traditional Medium Black

In native Android, both Chinese and English fonts are set to the default sans serif font.

  1. For versions prior to 4.0, the native Android font for English uses Droid Sans, and the native Android font for Chinese will use Droid Sans Fallback.
  2. After 4.0 , both Chinese and English fonts will use the native Android new Roboto font
  3. Other third-party Android systems also consistently choose sans serif fonts as default

Basic Interaction

Set the global CSS style to avoid the behavior of long-pressing the pop-up menu and selecting text in the figure

  1. a, img {
  2. -webkit-touch-callout: none; /* Disable long press on links and images to pop up menus */  
  3. }
  4. html, body {
  5. -webkit-user-select: none; /* Disable text selection (this is a must if no text selection is required) */  
  6. user-select: none;
  7. }

Mobile performance

Pay attention to the performance of low-end Android devices and 2G network scenarios !

Necessary checks before publishing

  • All images must be compressed
  • Consider moderate lossy compression, such as converting to jpg images with 80% quality
  • Consider splitting a large image into multiple smaller images, which is common when the banner image is too large.

Loading performance optimization to achieve fast opening

  • Data offline, consider caching data in localStorage
  • Initial requested resource number < 4 Note!
  • Images using CSS Sprites or DataURI
  • Avoid @import in external CSS
  • Consider embedding small static resources
  • The total size of the initial request resource after gzip is < 50kb
  • Are static resources (HTML/CSS/JS/Image) optimized and compressed?
  • Avoid packaging large libraries
  • Make sure Gzip compression is enabled at the access layer (consider increasing the Gzip level and using CPU overhead in exchange for loading time) Note!
  • Try to use CSS3 instead of images
  • Note: Lazy loading of static resources (JS/CSS) outside the initial first screen!
  • Image resources outside the initial first screen are loaded on demand (determine the visible area) Note!
  • Single-page application (SPA) considers delaying the loading of non-first-screen business modules
  • Enable Keep-Alive link reuse

Optimize operating performance to achieve smooth operation

  • Be careful to avoid iOS 300+ms click delay issue!
  • Caching DOM selections and calculations
  • Avoid actions that trigger page redrawing
  • Debounce continuously triggered events (scroll / resize / touchmove, etc.), avoid high-frequency triggering execution . Note!
  • Use event delegation whenever possible to avoid batch binding of events
  • Use CSS3 animation instead of JS animation
  • Avoid using a lot of CSS3 gradient shadow effects on low-end machines. Consider downgrading the effects to improve fluency.
  • Keep the HTML structure simple
  • Use CSS advanced selectors and wildcard selectors as little as possible
  • Keep it simple

Online Performance Testing and Evaluation Tool User Guide

  • Visit the Google PageSpeed ​​online rating site
  • Enter the target URL in the address bar and click the Analyze button to start detection.
  • Optimize according to the recommendations of PageSpeed ​​analysis, and prioritize solving problems in red categories

<<:  Barrage module

>>:  WeChat "death code" has now become a blackmail tool in their hands

Recommend

E-commerce operation full-year marketing activity plan layout

This sharing session is divided into three parts:...

There are so many online promotion channels, which one is suitable for us?

I still remember when I first entered the industr...

Analysis of the planning of a single product live broadcast room

A classmate asked me about the gameplay of "...

Swift Tip: Use build configurations to support conditional compilation

In Objective-C, we often use preprocessor directi...

UltimateAndroid 0.7.0 released, split UI module

UltimateAndroid rapid development framework relea...

For an in-depth analysis of oCPC, just read this article!

I have wanted to talk to you about conversion bid...

Growth Hacker's Guide: How to Improve User Retention

If you still invest huge budgets to attract new c...

Mini Program Development Page Sample Code

Page(Object object) Dongguan mini program develop...

Build a brand with public relations thinking

I have wanted to talk about this topic for a long...

Guide to editing information flow ads!

This article will share some key points and techn...

How do iQiyi, Youku and Tencent Video monetize advertising?

Most products in the PC era have a clear product ...

How to complete OPPO bidding within ten days?

After changing to a new job, the first task was t...

How can products be promoted effectively?

Many people write brilliant copy and make beautif...

Umeng: 5 tips to increase user activity through in-app communities

To what extent can the community influence the us...