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: