2个回答
展开全部
<!doctype>
<html>
<head>
<style>
#main {POSITION:relative; width:1000px; height:860px; left:50%; margin-left:-500px}
#main .test {float:left; width:320px; height:200px; margin:8px 5px; text-align:center; line-height:200px; color:#444; background-color:#dde}
#main .test:hover {color:#fff; background-color:#a84}
</style>
</head>
<body>
<div id=main>
<div class=test>请把鼠标移到这里</div>
<div class=test>请把鼠标移到这里</div>
<div class=test>请把鼠标移到这里</div>
<div class=test>请把鼠标移到这里</div>
<div class=test>请把鼠标移到这里</div>
<div class=test>请把鼠标移到这里</div>
</div>
</body>
</html>
更多追问追答
追问
谢谢您的回答,....但是我的每个div有两种颜色的字体,然后鼠标放到最大的div上两种字体的的颜色都变为白色。怎么实现呢 想了一下午和一个晚上 就是做不出来 好着急....
追答
<!doctype>
<html>
<head>
<style>
#main {POSITION:relative; width:1000px; height:860px; left:50%; margin-left:-500px}
#main .test {float:left; width:320px; height:200px; margin:8px 5px; background-color:#dde}
#main .test .a {height:100px; text-align:center; line-height:100px; color:#246; }
#main .test .b {height:100px; text-align:center; line-height:100px; color:#888; }
#main .test:hover {background-color:#a84}
#main .test:hover .a, #main .test:hover .b {color:#fff}
</style>
</head>
<body>
<div id=main>
<div class=test><div class=a>请把鼠标移到这里</div><div class=b>hehehehe</div></div>
<div class=test><div class=a>请把鼠标移到这里</div><div class=b>hehehehe</div></div>
<div class=test><div class=a>请把鼠标移到这里</div><div class=b>hehehehe</div></div>
</div>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询