JSFiddle - React, Tailwind, and code Playground
by Wil Chow
HTML
<div class='outer right'>
<div class="rbubble">Right Bubble with align right</div>
</div>
<div class='outer'>
<div class="lbubble">Left Bubble it should be on 2nd line with align left</div>
</div>
CSS
.outer {
display: block;
}
.lbubble, .rbubble {
position: relative;
padding: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 2px 2px 10px 0px #616161;
box-shadow: 2px 2px 7px 0px #616161;
display: inline-block;
margin-bottom: 8px;
}
.right {
text-align: right;
}
.lbubble {
background: lightblue;
}
.rbubble {
background: lightgreen;
}
.lbubble:after {
content:"";
position: absolute;
top: 5px;
left: -8px;
border-style: solid;
border-width: 10px 14px 10px 0;
border-color: transparent lightblue;
width: 0;
z-index: 1;
}
.rbubble:after {
content:"";
position: absolute;
top: 5px;
right: -8px;
border-style: solid;
border-width: 10px 0 10px 14px;
border-color: transparent lightgreen;
width: 0;
z-index: 1;
}