我正在创建一个仅使用css制作的标签列表。左边有一个箭头。但是,我想在每个周围添加一个边框。如何在箭头部分添加边框?
HTML:
<ul class="searchtags">
<li><a href="#">javaScript</a></li>
<li><a href="#">PHP</a></li>
<li><a href="#">HTML</a></li>
</ul>
CSS:
.searchtags {
padding: 0;
list-style-type: none;
}
.searchtags li,
.searchtags a {
float: left;
height: 24px;
line-height: 24px;
position: relative;
}
.searchtags a {
margin-left: 20px;
padding: 0 10px 0 12px;
background: #fff;
color: #4a4949;
text-decoration: none;
border: 1px solid #cacaca;
-moz-border-radius-bottomright: 4px;
-webkit-border-bottom-right-radius: 4px;
border-bottom-right-radius: 4px;
-moz-border-radius-topright: 4px;
-webkit-border-top-right-radius: 4px;
border-top-right-radius: 4px;
}
.searchtags a:before {
content: "";
float: left;
position: absolute;
top: 0;
left: -12px;
width: 0;
height: 0;
border-color: transparent #fff transparent transparent;
border-style: solid;
border-width: 12px 12px 12px 0;
}
.searchtags a:after {
content: "";
position: absolute;
top: 10px;
left: 0;
float: left;
width: 6px;
height: 6px;
border-radius: 50%;
border: 1px solid #bbb;
background: #fff;
}