CSS跨浏览器问题
我正在为学习英语作为第二语言的人们制作一个数字游戏。它使用的是使用 HTML5 的 WordPress 插件,以及作为后备的 Flash——这对我来说很重要,因为我的游戏的许多目标用户将在使用旧浏览器的亚洲。该游戏涉及 16 个音轨,这些音轨在页面上都是不可见的,一旦用户单击开始按钮,随机的一个将通过 JavaScript 淡入变得可见。
问题:在 Chrome 和 Safari 中,音频播放器已通过 CSS display: none
成功隐藏。然而,在我的 Firefox 5 中,浏览器(出于某种我不知道的原因,但出现这个问题是件好事)使用 Flash 播放器,并且样式不适用于它,因此 Firefox 的屏幕上有 16 个音频播放器。
这是我正在使用的CSS。
你知道如何让这个 CSS 也适用于 flash 播放器吗? 16 个音轨的 ID 为 1 - 16
#ONE, #TWO, #THREE, #FOUR, #FIVE, #SIX, #SEVEN, #EIGHT, #NINE, #TEN, #ELEVEN, #TWELVE, #THIRTEEN, #FOURTEEN, #FIFTEEN, #SIXTEEN {position: absolute; left: 0px; top: 0px; display: none; }
这是游戏的链接。请注意,游戏尚未完成,因此不要指望玩它。现在您只能看到 CSS 问题,具体取决于您的浏览器。
I'm making a numbers game for people studying English as a second language. It's using a WordPress plugin that uses HTML5 and, as a fallback, Flash -- this will be important for me because many target users of my game will be in Asia where older browsers are used. The game involves 16 audio tracks that are all invisible on the page and one random one will be made visible via javascript fade in once the user clicks the start button.
Problem: In Chrome and Safari, the audio player is successfully hidden via CSS display: none
. However, in my Firefox 5, the browser is (for some reason unknown to me, but it's good that this problem has arisen) using the Flash playeer and the styles are not applying to it, so there's 16 audio players on the screen in Firefox.
This is the CSS I am using.
Do you know a way to make this CSS apply to the flash player as well? The 16 audio tracks have ids from 1 - 16
#ONE, #TWO, #THREE, #FOUR, #FIVE, #SIX, #SEVEN, #EIGHT, #NINE, #TEN, #ELEVEN, #TWELVE, #THIRTEEN, #FOURTEEN, #FIFTEEN, #SIXTEEN {position: absolute; left: 0px; top: 0px; display: none; }
This is a link to the game. Note, the game is unfinished so don't expect to play it. Right now you can only see the CSS problem depending on your browser.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Firefox 3 上的行为也得到了证实。
这是我在第 5 个音频中使用 Firebug 看到的内容:
我们可以看到对象 id="f-FIVE" 的样式是visibility=visible。
如果将其更改为隐藏,则该控件将被隐藏。
behavior confirmed on Firefox 3 too.
Here what i see with firebug on the 5th audio:
We can see that the style of your object id="f-FIVE" is visibility=visible.
If you change it to hidden the control is hidden.
首先,您应该使用 HTML5 DOCTYPE。
其次,您似乎只提供 Firefox 不支持的 MP3 文件,而 Firefox 只支持 OGG。
使用 Firebug,我可以看到 Flash 播放器周围的许多 div 实际上都没有设置
display:none
。First of all you should be using the HTML5 DOCTYPE.
Secondly, you seem to be serving MP3 files only which aren't supported by Firefox, which only supports OGG.
Using Firebug I can see that none of the many divs surrounding the Flash player actually has
display:none
set at all.在每个
行的末尾有一些 JavaScript,看起来像这样:
这似乎是在说,如果浏览器是 mozilla,那么它应该显示您已设置为
display:none
的 div。你写这段代码的目的是什么?At the end of each
<!-- degradable html5 audio and video plugin -->
line there is some JavaScript that looks like this:Which seems to be saying that if the browser is mozilla, then it should show the div that you have set to
display:none
. What was you intention for this bit of code?