网页设计的一个关于盒子问题,救救孩子吧!

要使用

来制作一个鼠标悬浮的盒子问题
设置一下个大盒子,在里面鼠标到图片上时,边框变色。到文字上时,文字和边框变色。两种要分开来。而且图片在上是背景。文字要在下面居中,应该有还有内边框

你题目的解答代码如下:

<!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>

如有帮助,望采纳!谢谢!