JSFiddle - React, Tailwind, and code Playground

by CreativeDreams

HTML

<div class="wrapper">

<section>
  <div class="tooltip">
    tooltip
  </div>
  <div class="arrow">arrow</div>
</section>
</div>

SCSS

.wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vw;
}

.tooltip {
  position: absolute;
  z-index: 10;
  display: flex;
  height: 30px;
  width: 300px;
  background: lightcoral;
  transform: translateY(100%);
}

section {
  width: 300px;
  height: 300px;
  background: #ddd;
  border: 10px solid green;
  position: relative;
  padding: 10px;
  box-sizing: border-box;
}

.arrow {
  width: 100px;
  height: 50px;
  background: blue;
  position: absolute;
  top: 0;
  left: 0;
}