Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

Learn More

force font in a specific domain...

  • 4 个回答
  • 2 人有此问题
  • 20 次查看
  • 最后回复者为 deanone

more options

I prefer a specific font across most sites. However, with 'Allow pages to use their own fonts...' unchecked, is it possible to force a single domain to use its' own fonts with css?

I prefer a specific font across most sites. However, with 'Allow pages to use their own fonts...' unchecked, is it possible to force a single domain to use its' own fonts with css?

所有回复 (4)

more options

You can specify the font with code in userContent.css.


@-moz-document domain(<enter domain>){
html, body, body * { font-family: "<font name>" !important; }
}

The customization files userChrome.css (user interface) and userContent.css (websites) are located in the chrome folder in the Firefox profile folder.

  • Create the chrome folder (lowercase) in the <xxxxxxxx>.default profile folder if this folder doesn't exist
  • Use a plain text editor like Notepad to create a (new) userContent.css file in the chrome folder (file name is case sensitive)
  • Paste the code in the userContent.css file in the editor window
  • Make sure that you select "All files" and not "Text files" when you save the file via "Save file as" in the text editor as userContent.css.
    Otherwise Windows may add a hidden .txt file extension and you end up with a not working userContent.css.txt file

由cor-el于修改

more options

Thanx cor-el... I should have been more specific. I'm already utilizing a userContent.css file... A handful of sites do not display certain icons correctly if they are not allowed to use their own fonts. I would like to keep 'Allow pages to use their own fonts...' UNchecked in options but force a specific domain to behave as if it is checked. This way I can view them as is determined by the site meanwhile the rest of the web is using the font(s) specified in userContent.css. I hope this is clearer...

more options

What code do you use in the userContent.css file? Is that site specific with @-moz-document domain(){} rules or generic CSS rules for all websites?

more options

I'm using a specific font for all websites. This works just fine on 99% of the sites I visit... However, discogs.com (for example) will not display some icons correctly unless 'Allow pages to use their own fonts...' is checked.