Introduction to the Clip-path properties of CSS3

Source: Internet
Author: User

CSS3 's Clip-path

Clip-path is not very popular because of its browser compatibility issues. Many IE browser alignment properties are not very supported. Let's take a look at his browser compatibility:

We see IE is completely unsupported, try to use WebKit kernel, need to add kernel prefix-webkit-

Example:

Look at this effect and crop this div.

The code is as follows:  
 
 . Haorooms-small {    background-size:cover     width:300px     height:300px;    -webkit-clip-path:polygon (0% 50%, 25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%);     CLIP-PATH:P Olygon (0% 50%, 25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%); Clip-path attribute application   inset Clip-me {   /* Latest specification (no positioning requirements), */  Clip-path:inset (10px 20px 30px 40px); /* or "none"/ /* value refers to top, right, bottom, left four points/} The inset () function in the Clip-path attribute value has four values, respectively, representing Top/left and bottom/right Four dots, circle a rectangular area. The parts outside this rectangular area will be trimmed and hidden away.   Clip-path other attribute applications  . Clip-me {     /* Refer to an inline SVG path/  Clip-path:url (# C1);     /* References an external SVG   path */  CLIp-path:url (PATH.SVG#C1);    /* Polygon/  Clip-path:polygon (5% 5, 100% 0, 100% 75%, 75% 75%, 75% 100%, 50% 75%, 0% 75%);   &N Bsp * * Round/*   clip-path:circle (30px at 35px 35px);    /* Ellipse/  Clip-path:ellipse (65px 30px at 125px 40px);    /* Inset-rectangle () will replace inset ()? * *  /* Rectangle () may appear in SVG 2/   /* Rounded corner/  Clip-path:inset (10% 10% 10% 10% round 20%, 20%); nbsp SVG clipping Path Sample:    

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.