CSS3--Background clipping (background-clip)

Source: Internet
Author: User

1, background-clip syntax, value

  The CSS3 property Backround-clip is used primarily to determine the clipping area of the background (that is, how to control the element background display area).

Background-clip:border-box | | Padding-box | | Content-box

  = = "Border-box: This value is the default value, the background is clipped from the border area, that is, the outside portion will be clipped out;

  = = " Padding-box: The background is cropped from the padding area, and the background beyond the padding area is clipped;

  = = " Context-box: The background is cropped out from the content area, and the background beyond the context will be clipped;

2, Background-clip compatible

 Note: Background-clip in the Mozilla under the special sub-fine;

The Mozilla kernel (such as Firefox) does not support Border-box;padding-box;content-box syntax rules under version 3.6.

= = " Firefox3.6 version (with 3.6 version):  -moz-background-clip:border | | padding/   * Gecko 1.2-1.9.2 (Firefox 1.0-3.6) */
= = " Firefox4.0 version above: Support Border-box,padding-box,content-box, and no prefix required.
If you add "-moz", the firefox4.0+ version is the wrong way to do it. background-clip: border-box | | padding-box | | content-box/*firefox 4.0+ (Gecko) * *
Hint: detailed everyone can go to mozilla.org view Background-clip | -moz-background-clip. Although the online introduction of opera in the 9.6+ version of the support for the use of-o-background-clip attributes, but in fact there is a bug, until OPERA11 officially supported.

3. Background-clip Usage

compatible with the correct wording of each browser :
/*firefox3.6-*/-moz-background-clip:border | | Padding;/*webkit*/-webkit-background-clip:border-box | | Padding-box | | Context-box;

-o-background-clip:Border-box | | Padding-box | | Context-box;
/*W3C standard ie9+ and Firefox4.0+*/background-clip:border-box | | Padding-box | | Context-box;

4. Background-clip instance: Please click to view Http://www.w3cplus.com/content/css3-background-clip

Organized from:(w3cplus) CSS3 Background-clip

CSS3--Background clipping (background-clip)

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.