效果图

这是一个气泡框

.bubble {
position: relative;
padding: 10px;
border-radius: 8px;
background-color: #ddd;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.triangle {
position: absolute;
width: 0;
height: 0;
top: -10px;
left: 50%;
margin-left: -10px;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 10px solid #ddd;
}

.content {
font-size: 14px;
color: #333;
}

伪类

Hello World! .body { margin-top: 100rpx; margin-left: 100rpx; }

.bubble {
position: relative;
padding: 20px 12px;
font-size: 20px;
line-height: 26px;
color: #c0e3ff;
background: #122648;
border: 1px solid #4e637e;
border-radius: 10px;
}

.bubble::before,
.bubble::after {
position: absolute;
right: -20px;
bottom: calc(50% – 10px);
display: block;
font-size: 0;
line-height: 0;
border-color: transparent transparent transparent #122648 ;
border-style: solid;
border-width: 10px;
content: “”;
}