对话框样式
左侧
.chat-wrap-left {
font-size: 14px;
border-radius: 4px;
display: inline-block;
border: 1px solid #ddd;
position: relative;
box-sizing: border-box;
padding: 5px;
left: 10px;
}
.chat-wrap-left::before {
content: "";
width: 0;
height: 0;
border: 5px solid;
position: absolute;
top: 10px;
left: -10px;
border-color: #ddd #ddd transparent transparent;
}
.chat-wrap-left::after {
content: "";
width: 0;
height: 0;
border: 5px solid;
position: absolute;
top: 11px;
left: -7px;
border-color: #fff #fff transparent transparent;
}
右侧
.chat-message-item-right {
font-size: 14px;
border-radius: 4px;
background-color: #ddd;
position: relative;
box-sizing: border-box;
padding: 5px;
left: -10px;
float: right;
display: inline-block;
}
.chat-message-item-right::before {
content: "";
width: 0;
height: 0;
border: 5px solid;
position: absolute;
top: 10px;
right: -10px;
border-color: #ddd transparent transparent #ddd;
}
展示样式如下