Viewing MSDN code samples in Firefox or Mozilla browsers - Jon Galloway

Viewing MSDN code samples in Firefox or Mozilla browsers

UPDATE: This should no longer be required - apparently the MSDN CSS has been fixed to support Firefox.

The MSDN facelift (not MSDN2) hosed the formatting of code samples in Firefox and Mozilla browsers. To fix it, add this to your userContent.css file (chromEdit is the easiest way to modify this file):

/* Microsoft MSDN code stylesheet */
pre
{
 white-space: pre !important;
}

[Via WebLogs @ DotNetJunkies.com]
Published Thursday, September 30, 2004 10:57 AM by Jon Galloway

Comments

# re: Viewing MSDN code samples in Firefox or Mozilla browsers

Dude your tagline is hilarious!!! That movie was awesome.

Thursday, September 30, 2004 2:05 PM by Darrell

# re: Viewing MSDN code samples in Firefox or Mozilla browsers

I noticed this back in August, actually Scott Mitchell noticed this a long time ago, came up with the fix, MSDN implimented the fix, then broke it again, then fixed it, except in the MSDN library.

The problem with changing your userContent.css file is that it applies to ALL the websites you visit, which COULD break some of them. I came up with a little more precise way of doing it.

http://www.lazycoder.com/weblog/archives/2004/08/25/browing-msdn-with-firefox/

Thursday, September 30, 2004 2:30 PM by Scott

# re: Viewing MSDN code samples in Firefox or Mozilla browsers

Scott -
Agree, although you could narrow the definitions a bit so they'd be unlikely to be applied on other sites:

/* Microsoft MSDN code stylesheet */
pre.syntax
{
white-space: pre !important;
}

pre.code
{
white-space: pre !important;
}

This could be nested a bit further, so would only match the nested classes that MSDN uses.

Thursday, September 30, 2004 3:32 PM by Jon Galloway

Leave a Comment

(required) 
(required) 
(optional)
(required)