【发布时间】:2016-06-21 21:49:52
【问题描述】:
我需要创建一个带有像这样的信息徽章的圆形按钮:
如何在红色信息徽章周围的绿色按钮上制作斜角?
我不能在红色徽章周围使用普通的白色边框(如下面的 sn-p 所示),因为它必须是透明的并显示页面背景颜色。
.shape {
position: relative;
height: 50px;
width: 50px;
border-radius: 50%;
background: rgb(0, 199, 158);
margin: 25px;
}
.shape:after {
position: absolute;
content: '';
top: -10px;
right: -10px;
height: 25px;
width: 25px;
border-radius: 50%;
border: 3px solid white;
background: rgb(255, 67, 0);
}
body {
background: chocolate;
}
<div class='shape'></div>
【问题讨论】:
-
我在问题中添加了一个虚拟代码(带有白色边框的那个),因为没有代码的问题往往会被关闭(即使问题中的代码不是强制性的)。这是为了防止关闭一个原本很好的问题。如果您对我的编辑不满意,请随时回滚 :)
标签: html css border css-shapes