画一个有边缘色的三角形

<style type="text/css">
.chat-msg{
    width: 300px;
    height: 80px;
    border: 1px solid #ccc;
    border-radius: 8px;
    position: relative;
    filter: drop-shadow(0 0 2px #999);
    background: #fff;
}
.chat-msg:before{
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 10px solid #ccc;
}
.chat-msg:after{
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 10px solid #fff;
}
</style>
<div class="chat-msg">hi,亲</div>

猜你喜欢

转载自blog.csdn.net/qq_31680395/article/details/80115023