我想制作一个字体真棒图标的边框,如下所示。
如何使用css?
Screenshot
答案 0 :(得分:2)
见下文。希望这会有所帮助。
.icon-container {
background: darkgreen;
color: white;
width: 3rem;
height: 3rem;
display: flex;
justify-content: center;
align-items: center;
position: relative;
}
.icon-container::after {
content: "";
background: darkgreen;
width: 1rem;
height: 1rem;
position: absolute;
bottom: -5px;
left: calc( 50% - 0.5rem);
transform: rotate(45deg);
}

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<div class="icon-container">
<i class="fa fa-car fa-2x" aria-hidden="true"></i>
</div>
&#13;