CSS3 changes the background color of the page selected by default and disables full or partial selection of the page. css3 background color

Source: Internet
Author: User

CSS3 changes the background color of the page selected by default and disables full or partial selection of the page. css3 background color

Change the background color selected by default.

:-Moz-selection {background: # FF0000; color: # FFFFFF; }:: selection {background: # FF0000; color: # FFFFFF;} code :: -moz-selection {background: # FF0000; color: # FFFFFF;} code: selection {background: # FF0000; color: # FFFFFF ;}

Disable page Selection

/* Global */html, body {padding: 0px; margin: 0px; background: # fff; moz-user-select:-moz-none;-moz-user-select: none;-o-user-select: none;-khtml-user-select: none;/* you cocould also put this in a class */-webkit-user-select: none;/* and add the CSS class here instead */-ms-user-select: none;/** prohibit selected text */}

The above code is css3, so browsers below IE9 may be incompatible.

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.