Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like Firefox to display XML document trees in a monospace font, instead of using the default proportional serif font.

For a single document I can do this from the menu View->Page Style->Monospace, but it falls back to the default if I reload the document or fetch a new one.

Is there a way to permanently change the font used for rendering XML document trees in Firefox without affecting the way non-XML documents are rendered?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Note: The following solution will also affect the View Source browser.

  1. Edit the file C:\Program Files\Mozilla Firefox\res\viewsource.css
  2. Add the line font-family: monospace; to the *|*:root block.
  3. Restart Firefox.

Example (truncated file):

...
@namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */

*|*:root {
  background-color: white;
  color: black;
  font-family: monospace;
}
...
share|improve this answer
    
Not a very clean solution, but if it's the only way to accomplish what I want, I'll use it. Thanks. –  Lars Haugseth Jul 8 '10 at 10:56
    
By the way, I'm using Ubuntu Lucid, and there the file is located at /usr/lib/firefox-3.6.6/res/viewsource.css. –  Lars Haugseth Jul 8 '10 at 10:58
    
@Lars: Agreed, not a clean solution, but I couldn't think of another way. –  grammar31 Jul 8 '10 at 20:25
    
This solution does not work with Firefox 11 (the file does not exist). Is there another way? –  Markus Johnsson Apr 4 '12 at 7:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.