Use of clip-path polygon
body { background-color: #000; } .fa { border: 1px solid #fff; color:yellowgreen; padding: 10px; margin: 10px; } .fa>div { width: 110px; height: 110px; background-color: yellowgreen; margin: 20px auto; } .polygon1 { clip-path: polygon(50% 0px, 100% 100%, 0px 100%) } .polygon2 { clip-path: polygon(0px 50%, 50% 0, 100% 50%, 50% 100%) } .polygon3 { clip-path: polygon(0% 60%, 20% 0%, 60% 0%, 40% 60%) } <div class="fa"> <p>polygon</p> <p>The value is composed of multiple coordinate points. The first value is in the x direction, and the second value is in the y direction. </p> <p>The upper left corner is the origin, and the lower right corner is the point (100%, 100%). </p> <div class="polygon1"></div> <div class="polygon2"></div> <div class="polygon3"></div> </div> circle
body { background-color: #000; } .fa { border: 1px solid #fff; color:yellowgreen; padding: 10px; margin: 10px; } .fa>div { width: 110px; height: 110px; background-color: yellowgreen; margin: 20px auto; } .circle1 { clip-path: circle(50% at 50% 50%) } .circle2 { clip-path: circle(70% at 50% 50%) } .circle3 { clip-path: circle(30% at 10% 10%) } <div class="fa"> <p>circle</p> <p>The value consists of a coordinate point and a radius. </p> <p>The upper left corner is the origin, and the lower right corner is the point (100%, 100%). </p> <p>When defining the radius, you can use the at keyword to define the coordinates. </p> <div class="circle1"></div> <div class="circle2"></div> <div class="circle3"></div> </div> ellipse
body { background-color: #000; } .fa { border: 1px solid #fff; color:yellowgreen; padding: 10px; margin: 10px; } .fa>div { width: 110px; height: 110px; background-color: yellowgreen; margin: 20px auto; } .ellipse1 { clip-path: ellipse(30% 20% at 50% 50%) } .ellipse2 { clip-path: ellipse(20% 30% at 50% 50%) } .ellipse3 { clip-path: ellipse(60% 10% at 10% 10%) } <div class="fa"> <p>ellipse</p> <p>The value consists of the x-axis radius of the ellipse, the y-axis radius, and the coordinates of the positioning ellipse. </p> <p>The upper left corner is the origin, and the lower right corner is the point (100%, 100%). </p> <p>The at keyword separates the radius from the coordinates</p> <div class="ellipse1"></div> <div class="ellipse2"></div> <div class="ellipse3"></div> </div> inset The value is (top right bottom left round top left radius top right radius bottom right radius bottom left radius) The value before round represents the distance. If the first value is 25%, it means that the image is drawn starting from 25% on the top. body { background-color: #000; } .fa { border: 1px solid #fff; color:yellowgreen; padding: 10px; margin: 10px; } .fa>div { width: 110px; height: 110px; background-color: yellowgreen; margin: 20px auto; } .inset1 { clip-path: inset(25% 0% 25% 0% round 0% 25% 0% 25%) } .inset2 { clip-path: inset(0% 25% 25% 0% round 25% 25% 25% 0%) } .inset3 { clip-path: inset(25% 25% 0% 0% round 0% 25% 0% 25%) } <div class="fa"> <p>inset</p> <p>The value is (top right bottom left round top left radius top right radius bottom right radius bottom left radius)</p> <p>The value before round indicates the distance. If the first value is 25%, it means that the image is drawn starting from 25% on the top</p> <div class="inset1"></div> <div class="inset2"></div> <div class="inset3"></div> </div> The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. |
<<: How to use cursor triggers in MySQL
>>: Master the commonly used HTML tags for quoting content in web pages
Copy code The code is as follows: <meta name=&...
Detailed description of media device type usage: ...
This article shares the specific code of jQuery t...
From handicraft design to graphic design to web de...
background As we all know, after we develop a Jav...
I typed a wrong mysql command and want to cancel ...
Table of contents 1. Container service update and...
Because li is a block-level element and occupies ...
Win10 installs mysql5.7 decompressed version, for...
download Download address: https://redis.io/downl...
In response to the popularity of nodejs, we have ...
Recently, due to the need to test security produc...
Problem Description Several machines recently dis...
For some systems with large amounts of data, the ...
1. Embed is illegal The <embed> tag is a pri...