<!DOCTYPE HTML>
<head>
<title>提示框CSS实现</title>
<meta charset="utf-8">
<style>
.tp{
display:inline-block;
}
.tooltip{
visibility:hidden;
background-color:orangered;
color:#efefef;
border-radius:6px; /*圆角*/
padding:0 5px;
}
.tp:hover .tooltip{
visibility:visible;
}
</style>
</head>
<body>
<p class="tp">鼠标经过这里<span class="tooltip">很高兴见到你!</span></P><!--这里要注意把提示信息的<span>标签放到鼠标经过的<p>标签里面,不然没有效果 -->
</body>
</html>