带箭头的边框在右边中心

时间:2015-05-31 13:07:41

标签: css css3 css-shapes

我想像图片中那样编写边框。

enter image description here



p{
  border: 1px solid green;
}

<div class="container">
  <p>Some texts</p>
</div>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

&#13;
&#13;
.speechbubble{
    height:100px;
    width:100px;
    border:1px solid green;
    position:relative;
    background-color:white;
    border-radius:5px;
}

.speechbubble:after{
    height:10px;
    width:10px;
    border: 1px solid green;
    border-left:1px solid white;
    border-bottom:1px solid white;
    position:absolute;
    content:"";
    top:50px;
    right:-6px;
    transform:rotate(45deg);
    background-color:white;
}
&#13;
<div class="speechbubble"></div>
&#13;
&#13;
&#13;

此处还有working fiddle