css布局实现div和img标签变成五角星形状代码

代码语言:html

所属分类:布局界面

代码描述:css布局实现div和img标签变成五角星形状代码

代码标签: css 布局 div img 标签 五角星 形状 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  

  
  
<style>
/* Accurate version with precise values */
.one {
  width: 220px;  
  aspect-ratio: 1;
  clip-path: polygon(50% 0,
    calc(50%*(1 + sin(.4turn))) calc(50%*(1 - cos(.4turn))),
    calc(50%*(1 - sin(.2turn))) calc(50%*(1 - cos(.2turn))),
    calc(50%*(1 + sin(.2turn))) calc(50%*(1 - cos(.2turn))),
    calc(50%*(1 - sin(.4turn))) calc(50%*(1 - cos(.4turn))) 
   ); 
  background: #F8CA00;
}
/* A simplified version of the previous one.
   We do the calculation and we round the result */
.two {
  width: 220px;  
  aspect-ratio: 1;
  clip-path: polygon(50% 0,79% 90%,2% 35%,98% 35%,21% 90%);.........完整代码请登录后点击上方下载按钮下载查看

网友评论0