Firefox 水平菜单出现问题,其他浏览器都正常
请查看此处:http://fastforwardacademy.com/,然后查看此处:http://fastforwardacademy.com/index-page-irs-paid-registered-tax-准备者.htm。
在所有其他浏览器中... IE、Opera、Safari 和 Chrome 都没有问题,但 Firefox 无法正确显示菜单。看看CSS,有人知道为什么吗?
Please have a look here: http://fastforwardacademy.com/ and then have a look here: http://fastforwardacademy.com/index-page-irs-paid-registered-tax-preparer.htm.
In every other browser... IE, Opera, Safari, and Chrome there are no issues, but Firefox does not display the menu correctly. Looking at the CSS does anyone have any ideas why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根本原因是您的 HTML 严重无效:
http://validator.w3.org/check?uri=http%3A%2F%2Ffastforwardacademy.com%2F&charset=%28Detect+automatically%29& doctype=Inline&group=0
有问题的具体错误是这样的:
您将
li
元素嵌套在a
元素内(也在ul
元素内)。这是无效的,并且会导致 Firefox 呕吐吗?一个适当的单词选择,因为有问题的 Firefox bug 被称为..
呕吐错误
你的源代码看起来像这样:
但是 Firefox(版本 3,这在 Firefox 4 中已修复)将其合并到此(使用 Firebug 检查):
所以,修复方法是将
a
元素放置在li
元素内,而不是相反。您还必须切换一些 CSS。在一个不相关的注释上..
您的文档类型是这样的:
但是源代码的下一行是这样的:
并且您正在使用
。您可能希望将您的文档类型更改为此; XHTML 过渡文档类型:
The root cause is that your HTML is woefully invalid:
http://validator.w3.org/check?uri=http%3A%2F%2Ffastforwardacademy.com%2F&charset=%28detect+automatically%29&doctype=Inline&group=0
The specific error in question is this:
You're nesting an
li
element inside ana
element (also inside aul
element). This is invalid, and is causing Firefox to, shall we say, puke?An appropriate choice of word, because the Firefox bug in question is called..
The Vomit Bug
Your source code looks like this:
But Firefox (version 3, this is fixed in Firefox 4) munges it into this (checked with Firebug):
So, the fix is to place your
a
elements inside yourli
elements, instead of the other way around. You will also have to switch around some CSS.On an unrelated note..
Your doctype is this:
But the next line of source code is this:
and you're using
<br />
.You might want to change your doctype to this; the XHTML Transitional doctype:
问题是
.main_nav ul li a:hover, .main_nav ul li.current
的填充。单击时会应用一次填充,悬停时会应用第二次,这会导致链接不对齐。悬停时不需要填充。后
.main_nav ul li a:hover, .main_nav ul li.current
添加
The problem is padding for
.main_nav ul li a:hover, .main_nav ul li.current
. Padding is applied once when you click on the click and a second time on hover and that is making the link go out of alignment. You don't need padding on hover.After
.main_nav ul li a:hover, .main_nav ul li.current
Add