带下拉菜单的跨浏览器 CSS 水平导航 - 有这样的事情吗?
我创建了一个带有水平导航和一级下拉菜单的网站。它在除 IE7(下拉菜单不起作用)和 IE6(每个
和
均为 100% 正文宽度)之外的所有浏览器中都能正常工作。我讨厌在网上浏览另外 10 个教程并在所有浏览器中测试每个教程。调试我当前的可能需要更长的时间。我想知道是否有人有适用于所有浏览器的具体解决方案?这是一个很常见的设计元素。我很乐意依赖CSS、Javascript、浏览器黑客等——无论什么都能在所有浏览器中产生一致的可用导航。
tl;dr 您使用什么代码来实现带有下拉菜单的水平导航,以便在 IE6 和 IE7 中工作?
I've created a website with horizontal navigation and one level of dropdown menu on each. It works great in all browsers except IE7 (dropdowns don't work) and IE6 (each <li>
and <a>
is 100% body width). I'm loathed to go through another 10 tutorials on the web and test each one in all browsers. Debugging my current one will probably take even longer.
I wondered if anyone has a concrete solution that works in all browsers? It's such a common design element. I'm happy to rely on CSS, Javascript, browser hacks, etc - whatever produces a consistent usable nav in all browsers.
tl;dr What code do you use for horizontal nav with drop-down menus, to work in IE6 and IE7?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我脑海中浮现的是“Suckerfish Dropdowns”。
这是更新版本: http://www.htmldog.com/articles/suckerfish/dropdowns/< /a>
请注意,其中包含了使其在 IE6 中工作所需的 JavaScript 代码。
"Suckerfish Dropdowns" is what springs into my mind.
Here's an updated version: http://www.htmldog.com/articles/suckerfish/dropdowns/
Note that the required JavaScript code to make it work in IE6 is included.
几乎在我所有的设计中,我都必须添加 条件臭浏览器 IE6、IE7 和 IE8 的样式。与您分享的是,IE9 也不是更好,因为它不支持 CSS3 过渡。无论如何,我强烈建议您停止搜索包罗万象的解决方案,并尝试创建条件样式,如有必要,甚至 IE 的条件脚本,由于以下原因:
Almost in all of my designs, I had to add conditional styles for the stinky browsers IE6, IE7 and IE8. And to share with you, IE9 is not better, as it doesn't support CSS3 Transitions. Anyway, I strongly suggest that you stop searching an all-encompassing solution and try to create conditional styles and if necessary, even conditional scripts for IE, due to these reasons: