JSFiddle - React, Tailwind, and code Playground

by phollome

HTML

<div class="box1 sb5">I'm speech bubble</div>
<div class="box1 sb8">I'm speech bubble</div>

CSS

* {
  margin: 0px;
  padding: 0px;
}

.box1 {
  width: 300px;
  height: 200px;
  margin: 50px auto;
  border: 10px solid #00bfb6;
  /*padding: 20px;*/
  text-align: center;
  font-weight: 900;
  color: #00bfb6;
  font-family: arial;
  position: relative;
}


/* speech bubble 5 */

.sb5:before {
  content: "";
  width: 0px;
  height: 0px;
  position: absolute;
  border-left: 20px solid #00bfb6;
  border-right: 20px solid transparent;
  border-top: 20px solid #00bfb6;
  border-bottom: 20px solid transparent;
  right: -40px;
  top: 90px;
}

.sb5:after {
  content: "";
  width: 0px;
  height: 0px;
  position: absolute;
  border-left: 10px solid #fff;
  border-right: 10px solid transparent;
  border-top: 10px solid #fff;
  border-bottom: 10px solid transparent;
  right: -15px;
  top: 100px;
}


/* speech bubble 8 */

.sb8:before {
  content: "";
  width: 0px;
  height: 0px;
  position: absolute;
  border-left: 20px solid transparent;
  border-right: 20px solid #00bfb6;
  border-top: 20px solid #00bfb6;
  border-bottom: 20px solid transparent;
  right: -10px;
  bottom: -40px;
}

.sb8:after {
  content: "";
  width: 0px;
  height: 0px;
  position: absolute;
  border-left: 10px solid transparent;
  border-right: 10px solid #fff;
  border-top: 10px solid #fff;
  border-bottom: 10px solid transparent;
  right: 0px;
  bottom: -15px;
}