SOURCE

console 命令行工具 X clear

                    
>
console
<div class="bubble"></div>
<div class="bubble1"></div>
.bubble {
    width: 100px;
    height: 50px;
    /* background-color: blue; */
    position: relative;
    border-radius: 8px;
    border: solid gainsboro 1px;
    background-color: white;
}

.bubble::after {
    content: '';
    width: 0;
    height: 0;
    display: block;
    border-bottom: 10px solid transparent;
    border-top: 10px solid transparent;
    border-right: 10px solid transparent;
    border-left: 10px solid white;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: -20px;
}

.bubble::before {
    content: '';
    width: 0;
    height: 0;
    display: block;
    border-bottom: 11px solid transparent;
    border-top: 11px solid transparent;
    border-right: 11px solid transparent;
    border-left: 11px solid gainsboro;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: -22px;
}

.bubble1 {
    width: 100px;
    height: 50px;
    position: relative;
    border-radius: 8px;
    border: solid gainsboro 1px;
    background-color: white;
}
 
.bubble1::after {
    content: '';
    width: 0;
    height: 0;
    display: block;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white; /* 修改为上方边框,颜色为白色 */
    border-bottom: none; /* 移除下方边框 */
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(100%); /* 修改为将箭头定位到底部 */
    bottom: 0px; /* 调整箭头与元素底部的距离 */
}
 
.bubble1::before {
    content: '';
    width: 0;
    height: 0;
    display: block;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-top: 11px solid gainsboro; /* 修改为上方边框,颜色为边框色 */
    border-bottom: none; /* 移除下方边框 */
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(100%); /* 修改为将箭头定位到底部 */
    bottom: -1px; /* 调整箭头与元素底部的距离,比白色箭头稍低 */
}