- html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
- <meta name="google" content="Geovin Du 涂聚文">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <title>Clip Or Crop Images In HTML CSStitle>
- <meta name="Description" content="geovindu">
- <meta name="Keywords" content="geovindu">
- <meta name="author" content="geovindu">
- <style>
- /* (A) CLIP CIRCLE from https://code-boxx.com/clip-crop-images-html-css/*/
- .cropC { clip-path: circle(30%); }
-
- /* (B) CLIP TRIANGLE */
- .cropD { clip-path: polygon(50% 0, 0 100%, 100% 100%); }
-
- /* (C) CLIP DIAMOND */
- .cropE { clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
-
- /* (D) CLIP STAR */
- .cropF { clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
- style>
- head>
-
- <body>
- <img src="images/geovindu.png" class="cropC"/>
- <img src="images/geovindu.png" class="cropD"/>
- <img src="images/geovindu.png" class="cropE"/>
- <img src="images/geovindu.png" class="cropF"/>
- body>
- html>