<span class="my-icon">
Club Members
</span>
CSS:
.my-icon {
position: relative;
display: inline-block;
width: 10em;
height: 6em;
border: .5em solid blue;
top: 2em;
text-align: center;
padding-top: 1em;
font-family: sans-serif;
text-transform: uppercase;
z-index: 5;
background-color: #fff;
}
.my-icon::before {
position: absolute;
border: 2em solid #fff;
border-bottom: none;
border-top-right-radius: 2em;
border-top-left-radius: 2em;
left: 3em;
top: -2em;
content:'';
z-index: 3;
}
.my-icon::after {
position: absolute;
border: 2.5em solid blue;
border-bottom: none;
border-top-right-radius: 2.5em;
border-top-left-radius: 2.5em;
left: 2.5em;
top: -2.5em;
content:'';
z-index: 1;
}
这是我将得到的结果:
jsfiddle以上的html。
我想画坟墓(上面的半圆圈)红色。我该怎么做?
答案 0 :(得分:1)
将border
中的.my-icon::before
媒体资源更改为:border: 2em solid red;
答案 1 :(得分:1)
.my-icon::before {
position: absolute;
border: 2em solid **red**;
border-bottom: none;
border-top-right-radius: 2em;
border-top-left-radius: 2em;
left: 3em;
top: -2em;
content:'';
z-index: 3;
}
这就是全部。