A FireFox Friendly MSDN

Published 20 October 04 03:04 PM | Scott Mitchell

In a couple of previous blog entries of mine - Don't Make Me Use IE and Here's One Way to Win the Browser War - I expressed my frustration at MSDN Web pages not displaying code sections properly in FireFox. In Internet Explorer the code samples looked fine, but FireFox caused all of the code to be smushed together, without any whitespace between characters or lines of code.

Today I got some good news in the ol' InBox, as Lowell Meyer wrote in to tell me that MSDN's CSS files have been fixed to support FireFox. The following is Lowell's email (printed with permission from Lowell):

I know it’s been a couple months, but I wanted to let you know we’ve fixed the problem with the code samples in the library for non-IE browsers. The library (/library) is handled largely separately from the rest of the site, which is why it was still a problem. Code samples should now display correctly formatted, and they should word wrap when necessary. The developer center pages should still work as well, though they won’t have the nice text wrap when necessary like the library pages we’ve fixed here. We’re working the improved fix for the dev centers through the system as well, and everything should be perfect soon.

If you see any pages that still have the problem, please let us know. We’ve tried to find every CSS file that has this issue and fix it, but it is possible we might have missed one.

Here’s what we did: The fix was a pure CSS fix. The fix was to modify the <pre> tag style from the original (only part of the style shown for clarity):

pre
{
white-space:normal;
word-wrap:break-word;
}

To the new version:

pre
{
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}

If you check out the page you originally sent us as being broken, the fix is live and should be working correctly: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcompositionvsrendering.asp

Looks good, Lowell, thanks for following up.

Comments

No Comments

Archives

My Books

  • Teach Yourself ASP.NET 4 in 24 Hours
  • Teach Yourself ASP.NET 3.5 in 24 Hours
  • Teach Yourself ASP.NET 2.0 in 24 Hours
  • ASP.NET Data Web Controls Kick Start
  • ASP.NET: Tips, Tutorials, and Code
  • Designing Active Server Pages
  • Teach Yourself Active Server Pages 3.0 in 21 Days

I am a Microsoft MVP for ASP.NET.

I am an ASPInsider.