带有 css 动画的 Div 在 Chrome 中特别显示
我在 chrome 中特别显示表单时遇到问题(仅在 chrome 中,适用于 FF 和 safari)。
基本上,表单位于旋转 div 的顶部,z-index:2,后面的动画有 z-index:1
当我给表单一个更高的 z-index 时,单选按钮后面突然有一个白色方块,就像背景颜色一样,只不过没有背景颜色。此外,原本应该是黑色的文本阴影变成了白色。我无法消除这些影响,也不知道为什么会发生这种情况。
有人知道如何解决这个问题吗?
页面在这里: http://fatdogcs.com/rdv/index-test.html
就是这样在 Chrome 中看起来像: http://dl.dropbox.com/u/8974822/test.jpg
滚轮旋转的CSS代码:
#Wheel{
background-image:url(../images/circle.png);
-webkit-animation: rotateWheel 60s linear infinite;
-moz-animation: rotateWheel 60s linear infinite;
-ms-animation: rotateWheel 60s linear infinite;
height:370px;
width:370px;
position: absolute;
top: 195px;
left: 315px;
z-index: 1;
}
表单div的CSS代码:
#Over18Form{
width: 225px;
margin: 0 auto;
position:absolute;
top: 300px;
left: 387px;
z-index: 2;
}
Html代码是:
<div id="Wheel"></div>
<div id="Over18Form">
<form>
<div id="Over18"></div>
<input type="radio" name="age" id="Yes" />
<label for="Yes" style="margin-right:10px;">Yes</label>
<input type="radio" name="age" id="No" />
<label for="No">No</label>
<div id="ChooseLanguage"></div>
<input type="radio" name="language" id="English" />
<label for="English" style="margin-right:10px;">English</label>
<input type="radio" name="language" id="Chinese" />
<label for="Chinese">中文</label>
<div class="clear" style="margin-bottom:30px;"></div>
<button type="submit">Enter</button>
</form>
I have a problem with a form being displayed peculiarly in chrome(only in chrome, works in FF and safari).
Basically, the form is on top of the rotating div, with a z-index:2 and the animation behind has z-index:1
When I give the form a higher z-index, the radio buttons suddenly have a white square behind them, just like a background-color, except that there isn't any. Also, the text-shadow which is supposed to be black is turned white. I haven't been able to eliminate these effects and have no idea why this happens.
Anyone know how to fix this?
Page is here:
http://fatdogcs.com/rdv/index-test.html
This is how it looks like in Chrome: http://dl.dropbox.com/u/8974822/test.jpg
Css code for the wheel rotation:
#Wheel{
background-image:url(../images/circle.png);
-webkit-animation: rotateWheel 60s linear infinite;
-moz-animation: rotateWheel 60s linear infinite;
-ms-animation: rotateWheel 60s linear infinite;
height:370px;
width:370px;
position: absolute;
top: 195px;
left: 315px;
z-index: 1;
}
Css code for the form div:
#Over18Form{
width: 225px;
margin: 0 auto;
position:absolute;
top: 300px;
left: 387px;
z-index: 2;
}
Html code is:
<div id="Wheel"></div>
<div id="Over18Form">
<form>
<div id="Over18"></div>
<input type="radio" name="age" id="Yes" />
<label for="Yes" style="margin-right:10px;">Yes</label>
<input type="radio" name="age" id="No" />
<label for="No">No</label>
<div id="ChooseLanguage"></div>
<input type="radio" name="language" id="English" />
<label for="English" style="margin-right:10px;">English</label>
<input type="radio" name="language" id="Chinese" />
<label for="Chinese">中文</label>
<div class="clear" style="margin-bottom:30px;"></div>
<button type="submit">Enter</button>
</form>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当我删除 -webkit-animation:rotateWheel 60s 线性无限时,我尝试了一些东西;看起来还不错。
我建议:
1)使用JavaScript来旋转轮子,试试这个插件: http://ricostacruz.com/jquery.transit/< /a>
2)或者只是通过图像使用您自己的单选按钮作为png-24
(在将边框、div和-webkit-border-raidus与不同的z-index动画组合时,我遇到了类似的问题。)
I tried a few things, when I removed -webkit-animation: rotateWheel 60s linear infinite; it looked ok.
I would suggest:
1)Using JavaScript to rotate the wheel, try this plugin: http://ricostacruz.com/jquery.transit/
2) Or just use your own radio buttons via image as png-24
(I had a similar problem when combining borders, divs and -webkit-border-raidus with different z-index animations.)