x
 
<!DOCTYPE html>
<html>
<style>
.tooltip {
  position: relative;
  display: inline-block;
  border-bottom: 1px dotted black;
}
.tooltip .tooltiptext {
  visibility: hidden;
  width: 120px;
  background-color: black;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;
  /* 定位工具提示 */
  position: absolute;
  z-index: 1;
}
.tooltip:hover .tooltiptext {
  visibility: visible;
}
</style>
<body style="text-align:center;">
<p>请把鼠标移到下面的文字上:</p>
<div class="tooltip">移到我上面
  <span class="tooltiptext">工具提示文本</span>
</div>
<p>请注意,工具提示文本的位置不是很好。请返回教程并继续阅读如何以理想的方式放置工具提示。</p>
</body>
</html>