JSFiddle - React, Tailwind, and code Playground
by thelifeisyours
November 15, 2019
HTML
<div id="speechBubble_1" class="speechBubble bottomLeft">
<div class="speechBubbleText">Dummy tekst for Jonny sakuha ksugd hkauwh</div>
<div class="speechBubbleText">Dummy tekst for Jonny sakuha ksugd hkauwh</div>
<div class="speechBubbleText">Dummy tekst for Jonny sakuha ksugd hkauwh</div>
</div>
CSS
.speachBubble {
position: relative;
background: #fff;
min-height: 1em;
max-height: 3em;
max-width: 70%;
width: fit-content;
padding: 10px;
margin-bottom: 1em;
border: solid 2px #34373c;
cursor: pointer;
overflow-wrap: break-word;
}
.speachBubbleText {
width: 100%;
min-height: 3em;
}
/*
speachBubble arrow styles
*/
.bottomLeft {
border-radius: 6px 6px 6px 0px;
}
.bottomLeft::after {
content: '';
position: absolute;
bottom: -2px;
left: -10px;
border: solid;
border-width: 10px 10px 0px 0px;
border-color: transparent #34373c;
}
.bottomRight {
border-radius: 6px 6px 0px 6px;
}
.bottomRight::after {
content: '';
position: absolute;
bottom: -2px;
right: -10px;
border: solid;
border-width: 10px 0px 0px 10px;
border-color: transparent #34373c;
}
.topLeft {
border-radius: 0px 6px 6px 6px;
}
.topLeft::after {
content: '';
position: absolute;
top: -2px;
left: -10px;
border: solid;
border-width: 0px 10px 10px 0px;
border-color: transparent #34373c;
}
.topRight {
border-radius: 6px 0px 6px 6px;
}
.topRight::after {
content: '';
position: absolute;
top: -2px;
right: -10px;
border: solid;
border-width: 0px 0px 10px 10px;
border-color: transparent #34373c;
}
@keyframes textScroll {
}