Mobile Web design experience and experiences

Source: Internet
Author: User

Original: Mobile Web design experience and experiences

The smartphone development is really fast, like this year, most of my work is on the mobile page.

A few more years, see Mobile Version/Mobile version of the page, limited to the browser and mobile phone performance, 2g network speed, etc.

Web design is nothing but blue, black, white, the interface is monotonous, and should be as simple as possible design.

Now the situation is very different, the software on the WebKit kernel browser big line, hardware leaps and bounds, the speed, 4g is fried hot.

I would like to share with you some of my mobile web design experience and experiences.

⒈ Resolution
This should be the most concern of mobile Web page, because the mobile devices, various resolutions have. It takes a great effort to have a good browsing experience on these devices.

  • Use viewport: This is already a must for mobile Web page, it can set the width of the page, whether to allow zooming and so on.
    <name= "Viewport"  content= "Width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no "/>

    General Settings Width=device-width, is set to the screen width of the device, of course, it can be a specific value

  • percent and Max (min)-width use: Mobile Web page Not only the resolution is different, and at any time can be toggled, so the percentage width setting is necessary, and then with Max (min)-width limit the maximum (small) width, can effectively adapt to various resolutions, If you have a special need for this, see the next one, "Using Media Queries"

  • Use media Queries, which is part of the responsive web design

  •  <  link  rel  = "stylesheet"   type  = "Text/css"   href  = "Style1.css"   media  = "screen and (min-width:640px)"  >  
    The

    Here means that you can use the Style1 style in a screen width greater than 640px, or in a style, such as:

      @media screen and (min-width:640px)  { d1{b Ackground :  #ccc ;}   

      

⒉ 
Although the 4g is now firing hot, but can not deny the mobile device network environment limitations, so it is necessary to do some processing.

  • Using the manifest cache
    <manifest= "/mobile.manifest">

    Add manifest on HTML with file format content such as:

    CACHE manifest# #需要离线的内容CACHE: script/jquery.jsscript/gameconfig.jsimage/home.pngimage/logo.png# #总是访问网络的内容NETWORK :* # #访问A失败时访问BFALLBACK           

    The browser caches all of the content within the Chache and can be accessed offline , as long as any changes to the file are re-read and all caches are refreshed, so changing the comment is a good way to update the cache

    It's important to note that
    1, added manifest the current page will also be cached so the recommended way is page cache, page dynamic content is all used Ajax, so in the mobile site project design began to pay attention to this problem
    2. Add an iframe to the page and then sub-page reference manifest it is not valid to reach the cache resource without caching the current page content.

  • As far as possible using CSS style to replace the picture, because the mobile browser to CSS3 support, so that many previous pictures can be used to replace the style
    Some of the projects we use in our company:


    The button uses a gradient + fillet + inner Shadow
    . btn_red{Display:Block;Line-height:28px;padding:1px 0;Border:1px solid #B81414;Border-radius:2px;background:#FF5A5A;background:-webkit-gradient (linear, 0 0, 0 70%, from (#FF5A5A), to (#FF4444));Overflow:Hidden;Margin-top:3px;Color:#fff;Box-shadow:0px 1px 1px #FFB5B5 inset;}

    A triangle is a border color that changes color to draw a triangle that points in a different direction.
    . tip_t {Border-color: transparent transparent #bb0808 transparent; Border-style: solid; border-width: 10px; width: 0px; height: 0px;}

    The arrow is a two triangle stacked together
    ......
    Not only does the size decrease a lot after using the style instead of the picture, but the maintainability is greatly improved.
  • The page only shows some content, prompting the user to "click to expand" or "view more", and then asynchronously get the content, people do not want to open a website, traffic is gone

⒊ Layout
The visible area of the mobile phone is small, the layout is different from the traditional webpage, need to make full use of the limited space to display the information.

    • The page flow is simple and clear, complex operation as far as possible segmented display, such as:

    • Hide infrequently used features, you can put them in the sidebar or pop-up layer, such as:

    • Because the mobile side is operated directly with the finger, not the mouse. Therefore, the need to respond to the element click Area to be relatively obvious, large
    • The screen width is small, but the upper and lower slide experience is good, so the layout can be more up and down arrangement

⒋ Other and epilogue

    • Many small manufacturers of mobile phone tablets, there are some ROMs on the system default browser version of the different (very headache), so the test work to do enough
    • There are several new types of <input/> Type in HTML5, such as <input type= "Tel"/>, and clicking on the mobile side will pop up the numeric keypad by default, and you can try more
    • This article only summarizes some of my projects on the small experience, if there are mistakes and errors thank you for correcting, also welcome to point like and discussion

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.