JSFiddle - React, Tailwind, and code Playground
HTML
<div class="chat">
<div class="bubble me"><span class='tail'> </span>Hello there! Here's some more text for your bubble. And here's a bit more text so that wrapping happens.</div>
CSS
.chat {
width: 400px;
font-family: sans-serif;
font-size:small;
}
.bubble {
background-color: #F2F2F2;
border-radius: 5px;
box-shadow: 0 0 6px #B2B2B2;
display: inline-block;
padding: 10px 18px;
position: relative;
vertical-align: top;
}
.tail {
//box-sizing: border-box;
//border:1px dotted red;
position: absolute;
top: 12px;
left: -8px;
height: 18px;
width:18px;
overflow:hidden;
}
.tail:before {
//box-sizing: border-box;
//border:1px dotted green;
background-color: #F2F2F2;
box-shadow: 0 0 6px #B2B2B2;
content: "\00a0";
display: block;
position: absolute;
top: 0px;
left: 12px;
height: 12px;
width: 12px;
-webkit-transform: skew( -45deg );
-moz-transform: skew( -45deg );
}
.me {
float: left;
margin: 5px 45px 5px 20px;
}