[H-GEN] Mozilla, style sheets, and Microsoft's knowledge base

Jason Parker-Burlingham jasonp at uq.net.au
Mon Nov 11 00:32:47 EST 2002


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

Since I now have an interest in keeping a Windows 98 box as stable as
I can (no installing XP isn't really an option until we get a hardware
upgrade), I also have an interest in looking at Knowledge Base
articles, which turn out to be quite ugly by default when you're using
Mozilla, because of the following stylesheet entries:

        .KBPUBV2 UL LI { line-height: 120%; margin-bottom: -1%; margin-left: -0.3em; }
        .KBPUBV2 OL LI { line-height: 120%; margin-bottom: -1%; margin-left: -0.2em; }
        .KBPUBV2 .appliesto UL {  margin-top: -1em; }

(See
http://support.microsoft.com/common/css/GN/en-us/down-other/KBArticleV2.css
for the full source.)

The effect is that lists are pushed up over the text of the paragraph
above, and list items are smooshed on top of one another.  This makes
the page hard to read (and coincidentally does so on the parts of the
KB article one would like to read the most...).

This is because of those negative margin-top settings in MicroSoft's
stylesheet (I turned off the stylesheets one by one until I found the
one causing the problem[1].)

You can see this for yourself by navigating down the DOM tree in
Mozilla's Dom Inspector sidebar tab, flipping to the "Object" subtab
when you've found the right DOM element, and examining the CSS style
rules for that element.  They're listed by source (style sheet, and
line number) and you can mess with them at will there.

Fortunately this is all easily fixable.  The heavy-handed way I chose
was to edit userContent.css in ~/.mozilla/default/xxxxxx.slt/chrome/:

/*
 * Microsoft's knowledge base articles like to fuck around with
 * the ul top-margin setting.  Stop that!
 *
 * See:  http://support.microsoft.com/default.aspx?scid=kb;en-us;Q150314
 * for a good example.
 */
ul {
  margin-top : 1em ! important;
}
ul li {
  margin-bottom : 0px ! important;
}                                                             
ol {
  margin-top : 1em ! important;
}
ol li {
  margin-bottom : 0px ! important;
}                                                             

(I'm just guessing on the ol rules, but I *have* seen KB articles that
mess those up in the same way.)

Do any CSS2 or Mozilla experts know a better way to set these user
stylesheet rules?  Like, say "any value but not negative" or "only on
microsoft.com's website"?  Setting them unilaterally seems
heavy-handed.

jason

[1] : You can do this yourself by cutting and re-pasting the relevant
      "LINK" DOM nodes with Mozilla's DOM browser.
-- 
||----|---|------------|--|-------|------|-----------|-#---|-|--|------||
| ``It's just a big electric typewriter.''                              |
|                                                                       |
||--|--------|--------------|----|-------------|------|---------|-----|-|




--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.  See http://www.humbug.org.au/



More information about the General mailing list