我有一个项目,我需要插入语音泡沫/消息框.我试图实现的一般形状是这样的:

.bubble {
height: 100px;
width: 200px;
border: 3px solid gray;
background: lightgray;
position: relative;
cursor:pointer;
}
.triangle {
width: 0;
border-top: 20px solid black;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
cursor:pointer;
}Run Code Online (Sandbox Code Playgroud)
<div class="bubble">Speech bubble
</div>
<div class="triangle">
</div>Run Code Online (Sandbox Code Playgroud)
这当前没有通过命中测试,因为透明边框也是可点击的.
目标
命中框(可点击/可挖掘区域)需要坚持形状的边界(此处的透明边框也可以悬空,使此无效).
我需要在各种内容(图像,等级,文本......)上显示形状,
问题
操作这个形状时我遇到的主要问题是:
无论如何解决这些问题?
我刚刚遇到CSS Arrow请帮我创建CSS三角形.但是,这还不够.它只创建一个外部箭头,而我也想创建内部三角形.

以上就是在Photoshop中创建的.我能够使用CSS Arrow Please创建第一个能够,然后硬(呃)部分出现.如何创建包含外部(右对齐)和内部(左对齐)箭头的块,其中最后一个箭头仅包含内部(左对齐)箭头.
结果应该是a可点击的过程链.
要创建第一个,这是CSS
.arrow_box:first-child {
position: relative;
background: #1abc9c;
border: 5px solid #16a085;
}
.arrow_box:first-child:after, .arrow_box:first-child:before {
left: 100%;
top: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.arrow_box:first-child:after {
border-color: rgba(26, 188, 156, 0);
border-left-color: #1abc9c;
border-width: 16px;
margin-top: -16px;
}
.arrow_box:first-child:before {
border-color: rgba(22, 160, 133, 0);
border-left-color: #16a085;
border-width: 23px;
margin-top: -23px;
}
Run Code Online (Sandbox Code Playgroud)
但随后我的问题出现了:我将如何创建另外两个?
谢谢!
我们如何将 1px 边框应用于这些气泡?
这篇类似的 SO 文章在这里不起作用,因为我们使用不同的方法来生成语音气泡
.chat-messages {
width: calc(100%);
padding-bottom: 5px;
background-color: #f3f3f4;
}
.sb-time {
font-size: 10pt;
font-weight: 400;
margin: 7px -5px 0px 10px;
float: right;
}
.sb {
font-size: 13pt;
font-weight: 500;
border-radius: 6px;
display: block;
padding: 10px 15px 5px 15px;
position: relative;
vertical-align: top;
clear: both;
}
.sb::before {
content: "\00a0";
display: block;
height: 15px;
position: absolute;
top: 10px;
-moz-transform: rotate(30deg) skew(-35deg);
-ms-transform: rotate(30deg) skew(-35deg);
-o-transform: rotate(30deg) skew(-35deg);
-webkit-transform: rotate(30deg) skew(-35deg);
transform: rotate(30deg) skew(-35deg); …Run Code Online (Sandbox Code Playgroud)