【发布时间】:2012-02-29 11:08:06
【问题描述】:
我试图在 css3 中的 nvidia 页面(http://www.nvidia.com/object/cool_stuff.html)上做一些悬停效果,结果在这里http://www.html5.ssl2.pl/。现在你可以看到它不能很好地工作 - 当你将悬停一个 div 时,所有其他 div 都会移动,并且边框也有问题(提供更多空间)
代码:
<html>
<head>
<style>
body{
background: #eee;
margin:0;
padding:0;
}
div.nowy{
position:absolute;
width:200px;
height:100px;
background:grey;
border: 0px solid #eee;
-moz-transition: border 0.2s, box-shadow 0.2s;
-webkit-transition: border 0.2s, box-shadow 0.2s;
box-shadow: 1px 3px 3px black;
}
div.nowy:hover {
border:5px solid white;
box-shadow: 0px 2px 6px black;
}
</style>
</head>
<body>
<div style="width:800px; height:300px; margin-top:50px; margin-left:50px; position:relative">
<div class="nowy" style="left:100px;"></div>
<div class="nowy" style="left:350px;"></div>
<div class="nowy" style="left:600px;"></div>
</div>
</body>
知道如何解决这个问题吗? 感谢您的帮助。
【问题讨论】: