I am trying to make an arc like cut at the right of svg circle.

Current Result:

.ant-avatar-group {
    display: inline-flex;
}

.ant-avatar {
   width: 38px;
   height: 38px;
   line-height: 38px;
   font-size: 19px;
   background: #ccc;
   border-radius: 50%;
}
<div class="ant-avatar-group">
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle opacity="0.15" cx="20" cy="20" r="19" fill="#F6BB43" stroke="white" stroke-width="2">
</circle>
</svg>

<span class="ant-avatar"> </span>
</div>

Expected Result:

enter image description here

Code Tried:

Changed, cx="20" to cx="30"

Also adding,

margin-left: -8px; and border-left: 4px solid #fff to .ant-avatar makes the avatar icon to distort (loose its original size) of the right avatar circle.

.ant-avatar-group {
    display: inline-flex;
}

.ant-avatar {
   width: 38px;
   height: 38px;
   line-height: 38px;
   font-size: 19px;
   background: #ccc;
   border-radius: 50%;
}
<div class="ant-avatar-group">
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle opacity="0.15" cx="30" cy="20" r="19" fill="#F6BB43" stroke="white" stroke-width="2">
</circle>
</svg>

<span class="ant-avatar"> </span>
</div>

But this doesn't give the expected output as there needs to be arc like cut. Kindly help me to achieve the result making the svg circle with right arc as like the given expected result.

Big thanks in advance.

推荐答案

As I've commented I would put both circles in svg. For the image you can use clipPath to cut it in a circle shape.

For the other circle I'm usinga mask so that you can see through, since the mask is cutting a circular hole in it.

In CSS I've added a background to the svg. You can remove it

svg{width:300px; background:#efefef}
<svg viewBox="0 0 60 40">
  <defs>
    <mask id="m">
      <rect fill="white" x="0" y="0" width="100" height="40" />
      <circle cx="40" cy="20" r="18" fill="blabk" />
    </mask>
    <clipPath id="clip">
      <circle cx="40" cy="20" r="16" fill="00f" />
    </clipPath>
  </defs>
  <circle opacity="1" cx="20" cy="20" r="16" fill="#F6BB43" mask="url(#m)" />

  <image href="https://assets.codepen.io/222579/darwin300.jpg" x="21" y="2" width="35" height="35" clip-path="url(#clip)" />
</svg>

Html相关问答推荐

我需要主页按钮出现在中间

当表头包含特殊字符时,R Quarto发布的HTML表中不必要的大列宽

为什么从输入步骤中的扣减不能按预期进行?

让多对图像在各自的div中叠加

是否可以部分列出一个HTML有序列表

风格规则应该适用于响应图像的哪些方面?哪种规则适用于<;图片和gt;,哪种规则适用于<;img>;?

如果最后一行的卡数少于其他行,则在使用flex grow使卡在调整大小时拉伸后,flex卡的宽度将被拉伸

如何使用 Tailwind CSS 分隔导航栏中的元素?

如果使用复选框属性更改,如何防止事件更改?

是否可以制作响应式 CSS 剪辑路径?

为什么当我按第三个按钮时,前两个按钮会跳动?

jQuery 索引返回不正确的结果

如何调整边框半径以匹配父边框半径

绝对类在另一个绝对类之上

用于表行组标题的正确 HTML 标记是什么?

表格中每 4 行条纹一次

我无法设置使用 Tailwind CSS 创建的仪表板的网格 struct

我如何让这个动画播放,然后停止,然后在设定的时间后再次播放? (CSS)

在 React (NEXT) 中,当我try 进行动态补充时,我无法使用实例this来引用输入

CSS Padding 将右对齐的对象推离页面