2023-07-20T17:24:56.png

html

<div class="tooltip">这是默认提示框</div>

css

.tooltip {

  position: absolute;
  top: 1%;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px;
  background-color: #333;
  color: #fff;
  border-radius: 4px;
  font-size: 14px;
}