<分区>
<分区>
是否可以像这张图片一样添加 Angular (顶 Angular )?我不确定这种效果叫什么。如果是,您的方法是什么?
更新: 有人建议这个问题是重复的,不幸的是,重复的解决方案没有考虑到“翅膀”是用颜色填充的。虽然它非常适合具有轮廓的选项卡,但它具有实际填充。
这种技术叫什么?
最佳答案
我的方法是使用 :before
和 :after
伪类来添加和定位 Angular 尖。
.box {
position: absolute;
background: gray;
width: 400px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 0 0 10px 10px;
}
em {
display: block;
font-style: italic;
font-size: 1.1em;
color: white;
text-align: center;
margin: 0 auto;
width: 100%;
line-height: 2.2em;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}
.box:before,
.box:after {
content: '';
display: block;
border: 10px solid transparent;
border-top: 10px solid gray;
position: absolute;
top: 0;
}
.box:before {
left: -6px;
}
.box:after {
right: -6px;
}
<div class="box">
<em>Benefits Included In Members Savings Package</em>
</div>
关于css - 使用纯 css 创建 'wing' Angular 技巧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37040553/