搜尋 Mozilla 技術支援網站

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

了解更多

change default image style

  • 2 回覆
  • 8 有這個問題
  • 1 次檢視
  • 最近回覆由 brennr_rose

more options

I used the add-on "Old Default Image Style" for years to display image files in Firefox so that they would not be automatically centred on a black background which is the default. After upgrading to Quantum, the add-on is no longer supported. Is there any way modify the default image display to turn off the default centering and black background?

This is my only issue with the upgrade so far.

Thanks!

I used the add-on "Old Default Image Style" for years to display image files in Firefox so that they would not be automatically centred on a black background which is the default. After upgrading to Quantum, the add-on is no longer supported. Is there any way modify the default image display to turn off the default centering and black background? This is my only issue with the upgrade so far. Thanks!

被選擇的解決方法

This is a bit tricky because the only way I know to override the dark background on stand-alone image pages is going to affect all pages. That said, most pages either specify a body background color or leave it white, so perhaps that's not a problem?

@media not print{
  /* De-center the image if it's the very first element in a page body */
  body > img {
    margin: 0 !important;
  }
  /* Create a global off-white background */
  html {
    background-color: #fafafa !important;
  }
}

That style rule would go into a userContent.css file. More info on that file: http://kb.mozillazine.org/UserContent.css

從原來的回覆中察看解決方案 👍 2

所有回覆 (2)

more options

選擇的解決方法

This is a bit tricky because the only way I know to override the dark background on stand-alone image pages is going to affect all pages. That said, most pages either specify a body background color or leave it white, so perhaps that's not a problem?

@media not print{
  /* De-center the image if it's the very first element in a page body */
  body > img {
    margin: 0 !important;
  }
  /* Create a global off-white background */
  html {
    background-color: #fafafa !important;
  }
}

That style rule would go into a userContent.css file. More info on that file: http://kb.mozillazine.org/UserContent.css

more options

That works very well! Thanks for your incredibly fast reply. I appreciate your help.