IE的CSS问题 [英] CSS problem with IE

查看:79
本文介绍了IE的CSS问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我修改了suckerfish网站上的一些代码,用于CSS下拉菜单。适用于Safari和Firefox(Mac和PC)。但是在IE(PC)中,代码的一个测试版本可以工作但另一个不能。以下是您可以查看页面并查看源代码的链接:

live (在IE中没有工作)

测试(无处不在)


我已经查了代码,不明白为什么现场的人不应该工作在IE中,当测试一个。样式(颜色除外)是相同的。


请帮助吗?

I modified some code from the suckerfish site for CSS dropdown menus. Works fine in Safari and Firefox (Mac and PC). But in IE (PC), one test version of the code works but the other doesn''t. Here are the links where you can view the pages and see the source code if you want:

live (no work in IE)

test (works everywhere)

I''ve gone over the code and can''t see why the live one shouldn''t work in IE when the test one does. The styles (other than colors) are identical.

Help please?

推荐答案

我没有得到它。


我制作了另一个测试页面并将样式表放入主页面并剪切掉所有图形。仍然没有工作。一次拿出一件东西,直到我发现问题所在。


有两组导航链接,顶部和左侧栏。如果我删除左侧栏,它的工作原理。与其他人一样,这是一个带有LI的UL,只有我给了UL一个不同的ID。那里会发生某种冲突,但任何想法仍然会受到赞赏。现在就去修改实时页面。
I don''t get it.

I made another test page and put the style sheet in with the main page and cut out all the graphics. Still didn''t work. Took out one thing at a time till I found out where the problem was.

There are 2 sets of nav links, the top and the left bar. If I remove the left bar it works. It''s a UL with LIs just like the other one, only I gave the UL a different ID. There''s some kind of conflict going on there, but any ideas would still be appreciated. Gonna go fix the live page now.


我可以看到一些错误的东西
I can see a couple of things that are wrong
  1. id为nav的元素超过1个。网页上的ID应该是唯一的,如果不是,则行为是不明确的。
  2. 同样,有多个元素的id为vnav
  3. DOCTYPE中存在错误,两个引用部分之间缺少空格(查找&并在它们之间放置空格)



您的描述问题它不起作用不够好。不管怎么办?你没有看到菜单,它们的样式错误。当你不知道它是什么时,很难建议修复问题(尽管发布URL是一个好主意,我只是不可能是什么和不受欢迎的行为)。



但是,如果您想创作具有良好跨浏览器支持的网页,则需要编写有效的HTML页面。您可以在W3Cs网站上在线验证HTML http://validator.w3.org/。目前(如果我更正DOCTYPE)您的页面有60多个错误和警告。


Your description of the problem "it doesn''t work" is not good enough. Doesn''t work in what way? you don''t see the menus, they appear with the wrong styles. Hard to suggest a fix to a problem when you don''t know what it is (although posting the URLs was a good idea, I just couldn''t what was desired and undesired behaviour).


However if you want to author web-pages that have good cross browser support then you need to write Valid HTML pages. You can validate you HTML on line at the W3Cs site http://validator.w3.org/. Currently (if I correct the DOCTYPE) your page has 60+ errors and warnings.


您好,感谢您的回复。


我已经之前验证了一些HTML和CSS,但未在此网站上验证。但是这个菜单问题部分是由于我还不了解CSS,只是复制并粘贴教程中的代码。我想知道多个ID,但这就是教程所做的,所以我只是复制了它。我想我可以用类做同样的事情吗?或者我会使用ID作为导航栏,因为只有一个可以进行下拉菜单?


对模糊性感到抱歉。在IE中没有用的是菜单根本不会丢失,就像它没有认识到翻滚一样。 DOCTYPE错误来自我的编辑;我从不关注它。 (使用Taco,Mac的免费赠品)。我会清理它,看看我是否可以将多个ID转换为类。


再次感谢!
Hi, thanks for responding.

I''ve validated some HTML and CSS before but not on this web. But this menu problem is partly caused by my not knowing CSS that well yet, and just copying and pasting code from a tutorial. I wondered about the multiple IDs but that''s what the tutorial did, so I just copied it. I assume I could do the same thing with classes then? Or I would use ID for the nav bar since there''s only one that does dropdowns?

Sorry about the vagueness. What didn''t work was in IE the menus wouldn''t drop at all, like it didn''t recognize the rollover. The DOCTYPE error came from my editor; I never pay much attention to it. (using Taco, a freebie for the Mac). I''ll clean that up and see if I can convert the multiple IDs to classes.

Thanks again!


这篇关于IE的CSS问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆