How to create this shape with css and html?

问题描述 投票:0回答:3

我想创建下图中给出的形状,但我的代码不符合我的要求,我不知道如何创建这个请帮助我用 HTML 和 CSS 创建这个形状它应该看起来像一个图像,谢谢你。

.star
        {
            font-size: 100px;
            background-color: aqua;
            color: white;
            
        }
<small class="star">&#9055;</small>

javascript html css css-shapes shapes
3个回答
3
投票

我用过

clip-path
, 它是一个你可以玩的 POC:

body {
  background: aqua;
}

.star-background {
  background: white;
  border: solid #02b7b7 1px;
  border-radius: 50%;
  padding: 25px;
  height: 300px;
  width: 300px;
}

.star {
  height: 300px;
  width: 300px;
  background: aqua;
  clip-path: polygon(50% 0%, 64% 30%, 98% 35%, 71% 58%, 79% 91%, 50% 73%, 21% 91%, 29% 57%, 2% 35%, 36% 30%);
}
<div class="star-background">
  <div class="star"></div>
</div>


0
投票

现在我用相同的颜色创建了相同的形状

.star
        {
           font-size: 100px;
            background: -webkit-linear-gradient(#e8e8e8 50%, #fff 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
            
        }
        .stardiv{
        background-color:#00ced1;
        height:100%;
        width:100%;
        }
<div class="stardiv">
<small class="star">&#10026;</small>
<div>


0
投票

使用 buildez 网站,然后使用剪辑路径功能来做

© www.soinside.com 2019 - 2024. All rights reserved.