Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Este site está com funcionalidades limitadas enquanto realizamos manutenção para melhorar sua experiência de uso. Se nenhum artigo resolver seu problema e você quiser fazer uma pergunta, nossa comunidade de suporte pode te ajudar em @FirefoxSupport no Twitter e /r/firefox no Reddit.

Pesquisar no site de suporte

Evite golpes de suporte. Nunca pedimos que você ligue ou envie uma mensagem de texto para um número de telefone, ou compartilhe informações pessoais. Denuncie atividades suspeitas usando a opção “Denunciar abuso”.

Saiba mais

Esta discussão foi arquivada. Faça uma nova pergunta se precisa de ajuda.

Firefox 4.0 Windows 7 a site looks fine in Explorer but the menu and sub menu looks wrong with Firefox. Javascript is enabled. How to fix?

  • 7 respostas
  • 10 têm este problema
  • 1 exibição
  • Última resposta de FriscoBill

more options

I made a website and it looks fine in Internet Explorer with the Windows 7 operating system. When viewing with Firefox the main menu and the sub menus look wrong and the sub menus are not useable because they appear on top of the main menu. How do I fix this?

I made a website and it looks fine in Internet Explorer with the Windows 7 operating system. When viewing with Firefox the main menu and the sub menus look wrong and the sub menus are not useable because they appear on top of the main menu. How do I fix this?

Solução escolhida

As a starting point, I recommend the most liberal DOCTYPE (which I listed above).

cor-el's post shows an edit to one of the scripts on your site so that the number of pixels is followed by the letters 'px' (Firefox requires units of measurement, in this case, pixels).

Ler esta resposta 👍 1

Todas as respostas (7)

more options

A couple thoughts.

First, your HTML does not have a DOCTYPE declaration at the top. As a result, Firefox will lay out the page using the rules of "Quirks" mode instead of a web standards mode. This can lead to more differences from IE and other browsers. To experiment with a DOCTYPE declaration, try this (from W3C QA - Recommended list of Doctype declarations you can use in your Web document):


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Note: that could break your page in IE, so you probably should work on a copy of the page.

Second, you may want to check your menu script to make sure it was designed with compatibility for Firefox. If this is your own script, you can get more assistance on the mozillaZine Web Development board. Separate forum, separate registration. Please note the tips in the Sticky Post at the top of the forum before posting.

more options

Thank you for your reply. I tried the DOCTYPE you posted above as well as several I found at W3C QA for recommended Doctype Declarations. At least five different suggested DOCTYPES worked with IE. None worked with Firefox. I am still trying to find something that will work. I got the script from a fellow online several years ago and modified it some when making the page. I use NOTEPAD to make the page. It always worked OK with IE until the latest version when the height needed to be slightly changed in the menu section. I never could get it to work correctly with Mozilla Firefox (any version).

more options

Looks like you aren't adding a px unit to the top and left values for the ns6 part for Firefox

function a4(c8){
 var tmi=c8; c2[c3[c8].d4].b5=c8;
 if(c3[c8].sub != 0){ 
  if(ns6){ 
  mnn=document.getElementById('vrsub'+c3[c3[c8].sub].c4);
  mnp=document.getElementById('vrsub'+c3[c8].c4);
  mnn.style.top=mnp.offsetTop+(c3[c8].c9*c3[c8].d1)+c2[c3[c8].d4].b3+'px';
  mnn.style.left=mnp.offsetLeft+c3[c8].d2+c3[c8].a9-c2[c3[c8].d4].b2+'px';
  mnn.style.visibility="visible";
  }
 };
};

Alterado por cor-el em

more options

Thank you for your reply. I am really very new to this and trying to learn.

Where exactly does the above info get inserted?

Don't I still need to show a DOCTYPE and which one?

Sorry to be such a bother. I'm just trying to figure out how to fix so the site is correctly shown with IE and Firefox.

more options

Solução escolhida

As a starting point, I recommend the most liberal DOCTYPE (which I listed above).

cor-el's post shows an edit to one of the scripts on your site so that the number of pixels is followed by the letters 'px' (Firefox requires units of measurement, in this case, pixels).

more options

The CSS menu works for me with the modified function a4 that I posted above.

You can find the code in this file:

Search for function a4 and then find the if(ns6) section.

more options

Many thanks to Jscher2000 and Cor-el for your very helpful info. I modified the menu.js as suggested and added the DOCTYPE suggested. I also changed a few other things as I still had a slight problem viewing the main menu in Firefox. All seems well now. Thank you for your very welcome and much needed assist.

Alterado por FriscoBill em