下拉菜单在 IE 中无法正常工作 - 向右射击
我被困住了。我以前从未做过下拉菜单,但想在我正在开发的网站上尝试一下,所以我导入了别人的 java 和 css 代码,并让它在 Firefox 中运行得很好。问题是,下拉菜单在 IE 中显示在右侧。
我已经为 IE 创建了一个单独的样式表,但我无法弄清楚要在上面添加什么来纠正这个问题!
这是网站: http://www.erricksonequipment.com
该样式表中有很多多余的废话,因为它是从一个在线示例。也就是说,那里也可能存在阻止 ie 正确读取的问题?我不确定..我对这个 java/css 下拉菜单很陌生! :)
任何帮助将不胜感激。
I'm stuck. I've never done drop down menus before but wanted to try on a site I'm working on, so I imported someone else's java and css code and got it running just fine in Firefox. Problem is, the drop down menus are appearing way off to the right in IE.
I've created a separate style sheet just for IE, but I haven't been able to figure out what to put on it to correct this!
Here's the site:
http://www.erricksonequipment.com
There is a lot of superfluous nonsense in that style sheet as it was imported from an online example. That said, there may be issues in there too that are preventing ie from reading correctly? I'm not sure.. I'm new to this java/css drop down menu stuff! :)
Any help would be GREATLY appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您用于下拉菜单的脚本不太好。此外,完全可以仅使用 CSS 创建整个下拉菜单,而不需要任何 JS。
在当前状态下,下拉菜单在 IE7 或 IE8 中不起作用。
本着“解决您的问题”的精神:
它将在 IE8(和 Firefox 等)中工作
如果您将
dropdownMenuKeyboard.js
中的第 203 行从这个:更改为这个:,但是,我建议您替换具有更现代的下拉菜单代码。
The script you're using for the drop down menu is not very good. Also, it's quite possible to create that whole drop down menu using just CSS, without any JS.
The drop down menu, in its current state, does not work in IE7 or IE8.
In the spirit of "fixing your problem":
It will work in IE8 (and Firefox, etc) if you change Line 203 in
dropdownMenuKeyboard.js
from this:to this:
However, I recommend you replace the drop down menu code with something more modern.
使用“em”作为测量单位时要小心。 1 'em' 的大小是相对于浏览器中设置的默认字体大小(如果您定义的话,则在 CSS 中设置)。默认情况下,Firefox 和 Internet Explorer 之间的这些字体大小不同。我建议改用像素,但如果您决定使用“em”,请务必通过执行以下操作在 CSS 中添加新的默认字体大小:
html { font-size: 16px; 通过标准化
整个浏览器的默认字体大小,您将不会在 Firefox 或 Internet Explorer 中看到任何差异。
Be careful when using 'em' as your unit of measurement. The size of 1 'em' is relative to the default font-size set in your browser (or in your CSS if you define it). By default, these font-sizes differ between Firefox and Internet Explorer. I'd recommend using pixels instead, but if you're set on using 'em', just be sure to add a new default font-size in your CSS by doing something like:
html { font-size: 16px; }
By standardizing the default font-size throughout the browser, you won't see any differences in Firefox or Internet Explorer.