要使用
来制作一个鼠标悬浮的盒子问题你题目的解答代码如下:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title> 页面名称 </title>
<style type="text/css">
#box {
position: relative;
width: 300px;
height: 500px;
border: 5px solid #669;
background: url("1.jpg") no-repeat top center;
}
#box:hover {
border: 5px solid #f00;
}
#box p {
position: absolute;
left: 0;
right: 0;
bottom: 0;
font-size: 24px;
line-height: 50px;
height: 50px;
text-align: center;
background: #ddd;
color: #00f;
margin: 0px;
padding: 10px;
}
#box p:hover {
color: #f09;
}
</style>
</head>
<body>
<div id="box">
<p>文字文字</p>
</div>
</body>
</html>
如有帮助,望采纳!谢谢!