Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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(; /* 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

There's a Firefox plugin that does exactly that:

share|improve this answer
True, but this feels quite spammy for a plugin that was released 4 days ago and has 6 users. How are you affiliated with this? Are you really David? – Arjan Oct 19 '14 at 9:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .