Fixed-width font with Gmail

Catagory: general
I love Gmail. I can't imagine my email any other way. I was invited to join quite a while ago, so many of the features it has today were not available and access at times could be hit and miss. Today, it is one of the most stable web apps you can find on the internet (IMHO of course).

As much as I love Gmail, it has always bothered me that I must compose and read my emails using a variable-width font. I guess I'm just an old crusty Unix guy, but emails should be text-only and that text should be displayed in a fixed-width font. I get a lot of system stat and summary emails from the various Unix systems I administer. They're text-only and rely on tabs and spacing to be easily read. The default varibale-width font creates no end of havoc on the format of these emails. Until now, I had always viewed the email source (More options -> Show original) to get the proper formatting. Now I don't have to.

In firefox, you can override any stylesheet with a custom setting in the firefox config. The file where these overrides are specified can be found under your firefox profile. Spcifically at <your profile>/chrome/userContent.css. Create or edit this file with the following content.

div.msg div.mb {
    font-family: monospace !important;
    font-size: 12px !important;
}

textarea.tb {
    font-family: monospace !important;
    font-size: 12px !important;
}

td.ct {
    font-family: monospace !important;
    font-size: 12px !important;
}



This will override the specific stylesheet classes that Gmail uses. It will not affect html email, but will allow text-only email to be displayed with a fixed-width font. You'll also be able to compose your emails with a fixed-width font.

I ran across the first override (div.msg div.mb) on the net somewhere. If I can find that site again, I'll quote the source. The second override I found by using the "View Selection Source" function in firefox (quite handy BTW).

As far as I can tell, these overrides interfere with nothing else in Gmail. I use these settings both on my Linux machines and my one Windows laptop.

Enjoy.

UPDATE (Mon 18 Apr 22:54:13 JST 2005): I found the site where I discovered the first CSS override.

UPDATE (Wed May 18 15:54:17 JST 2005): I just printed something with Gmail (obviously I don't print that much). The fixed-font overrides do not work with the "printable" stylesheet. When I get a few minutes, I'll see if I can figure this one out.

UPDATE (Wed May 18 16:32:54 JST 2005): I figured it out. I've updated the shaded list of CSS overrides to include one for the "printable" page (td.ct). I've not extensively tested this, but it doesn't appear to affect anything else.



posted Mon 18 Apr 16:56:31 PDT 2005 by mikeg - permalink

Comments

GW4E1 wrote:

This is wonderful! THANK YOU!

Thu 05 May 17:23:43 PDT 2005

ohshady wrote:

Hi!
The new @-moz-document feature can make things cleaner...

http://lists.w3.org/Archive...

Fri 07 Oct 15:50:17 PDT 2005

Greg Donald wrote:

FYI, this CSS doesn't work with http://mail.google.com/mail..., only http://mail.google.com/mail...

Tue 15 Apr 16:46:52 PDT 2008

Add Comments

This item is closed, it's not possible to add new comments to it or to vote on it


© 2002-2007 Michael Gauthier
Bother the webmaster at webmaster@3cx.org.


Our VPS Hosting
by RimuHosting
Java and Linux VPS Hosting by RimuHosting

Real Ultimate Power!

[QUIT SLASHDOT TODAY]