Skip to content
0
/ Blogs/有趣的 CSS clip-path
3/12/2025
1m
AI 摘要

本文介绍了 clip-path 属性的用法,重点展示了通过 polygon() 函数实现复杂形状裁剪的 CSS 代码示例,适用于图像裁剪和视觉设计。

CSS Clip Path

关于 clip-path 属性的一些用法

<img src="/avatar.png" class="target" />
<style scoped>
.target {
  clip-path: polygon(
    50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%,
    50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%
  );
}
</style>

Released under the MIT License.