<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.box{width: 300px;height: 40px;background: #ccc;margin: 20px auto;position: relative;}
.box *{margin: 0;}
.box h2{line-height: 40px;}
.box p{width: 200px;background: #eee;font-size: 14px;position: absolute;left:0;top:0;display: none;z-index: 1;}
#box{width: 100px;height: 100px;background: red;display: block}
#box:hover{display: none;}
</style>
</head>
<body>
<div class="box">
<h2>这是一个标题1</h2>
<p>这是标题1对应的详细文本这是标题1对应的详细文本这是标题1
对应的详细文本这是标题1对应的详细文本这是标题1
对应的详细文本这是标题1对应的详细文本这是标题1</p>
</div>
<div class="box">
<h2>这是一个标题2</h2>
<p>这是标题2对应的详细文本题2对应的详细文本题2对应的详细文本题2
对应的详细文本题2对应的详细文本题2对应的详细文本题2
对应的详细文本题2对应的详细文本题
js实现跟随鼠标移动的提示框
最新推荐文章于 2024-07-23 16:14:20 发布