為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Is there a limit to the number of selectors you can have in a CSS file for Mozilla Firefox to work?

  • 2 回覆
  • 1 有這個問題
  • 1 次檢視
  • 最近回覆由 cor-el

more options

I am writing the CSS code for my website and the CSS is being interpreted correctly by Chrome but is not even being read by Mozilla Firefox. When I use firebug, I can see that the classes appear in the HTML code but are not interpreted in the CSS.

The code for this page was recently added, which puts it on the bottom part of my CSS file. The CSS file has over 2.000 lines. Is it possible that Mozilla Firefox is limiting the number of lines it reads? If so, should I split the code in two or three CSS files (what is the limit per file)?

Thank you!

I am writing the CSS code for my website and the CSS is being interpreted correctly by Chrome but is not even being read by Mozilla Firefox. When I use firebug, I can see that the classes appear in the HTML code but are not interpreted in the CSS. The code for this page was recently added, which puts it on the bottom part of my CSS file. The CSS file has over 2.000 lines. Is it possible that Mozilla Firefox is limiting the number of lines it reads? If so, should I split the code in two or three CSS files (what is the limit per file)? Thank you!

所有回覆 (2)

more options

I don't think it's an issue of file length, however, as a test you could revert to your previously working file and place all the new CSS in a new file, and see whether that makes any difference.

If you clear the error console and reload the page, do you get any unexpected style warnings? By unexpected, I mean things other than, for example, -webkit-transform is not recognized and is being dropped. Illogical messages can indicate an unnoticed typo.

more options

There is usually an error in the file (e.g. a missing quote) if Firefox doesn't read all rules.

The Error Console (Ctrl+Shift+J) or the Web Console (Ctrl+Shift+K) should show such an error, that possibly had a notification that Firefox reached end of file trying to recover.