搜尋 Mozilla 技術支援網站

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

了解更多

question about IE filter: alpha(opacity=50); command

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

more options

I am trying to program web code across multiple browsers: Internet Explorer, Firefox, Google Chrome, Opera and Safari. The firefox css rule

{opacity: 0.5;}

will not run on internet explorer, which requires

filter: alpha(opacity=50);

which throws an error in firefox.

Without leaving css, is there a way to include one opacity command, or a number of them while producing no errors, in an html script web file?

I am trying to program web code across multiple browsers: Internet Explorer, Firefox, Google Chrome, Opera and Safari. The firefox css rule {opacity: 0.5;} will not run on internet explorer, which requires filter: alpha(opacity=50); which throws an error in firefox. Without leaving css, is there a way to include one opacity command, or a number of them while producing no errors, in an html script web file?

所有回覆 (1)

more options

It is not really a problem that the unrecognized filter code shows as an error in the Tools > Error Console. Firefox will ignore rules that are not recognized.

You need to add both rules or maybe more, if Safari or Opera also require their own code, if you want to support all browsers. You can do some browser sniffing for Gecko and load a specific stylesheet for Firefox, but that shouldn't be needed in most cases.