Three problems and solutions in mobile Web development

Source: Internet
Author: User

Hello everyone!

This is my second time to write essays, there are shortcomings in the hope that we put forward, I also counted a small white, their own into the front-end industry has just half a year, where I met a technical Daniel good leadership, let me in the project to learn a lot, want to share with you!

One. Disable selection on the mobile side

If you don't want the user to be able to select the content on the page, you can disable it in the CSS:

. user-select-none {

-webkit-user-select:none; /* Chrome All/safari all */

-moz-user-select:none; /* Firefox All (not required on mobile) */

-ms-user-select:none; /* IE + + *

}

Two. Remove touch highlighting from the mobile side

When you do the mobile page, you will find all a tags in the trigger click or all set Pseudo-class: Active elements, the default will be in the activation state, the display of the Highlight box, if you do not want this highlight, then you can use CSS following methods to do global suppression:

HTML {

-webkit-tap-highlight-color:rgba (0, 0, 0, 0);

}

However, this method is not valid on Samsung's machine, there is a compromise method is to replace the page non-real jump link a tag to other tags, can solve the problem.

Three. How to disable saving or copying images (IOS)

Usually when you press and hold the image img on your phone or pad, the option to store the image or copy the image will pop up, and if you don't want the user to do so, you can disable it in the following ways:

img {-webkit-touch-callout:none;}

Three problems and solutions in mobile Web development

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.