Firefox rendering HTML incorrect sometimes

后端 未结 4 935
暗喜
暗喜 2021-01-21 13:11

I developed a css menu and it has worked fine across all browsers in my testing (pure html/css). When we brought the code into our development environment which is running on ca

4条回答
  •  被撕碎了的回忆
    2021-01-21 13:57

    As mentioned in comments, your markup is not strictly valid (empty a or div inside a). To me, this means that, while it may render the way you want in most browsers, it's meaningless to say it renders 'correctly' here and not there.

    My advice is to fix your markup so that it validates first. Once you have valid markup, you can expect nice browsers like recent Firefox to render it 'correctly' and then troubleshoot any browser-specific issues that remain.

    w3c validator: http://validator.w3.org/

提交回复
热议问题