[Prev][Next][Index][Thread]

Re: Multiple stylesheet inclusion?



Benjamin Sittler writes:

 |How can I refer to several stylesheets, to be applied consecutively to my
 |document? I'm interested in writing a "generic look" style and applying
 |various "section styles" for different parts of my document tree. As an
 |artificial example, I would like one color scheme on my homepage (a "home
 |style" applied on top of the "generic look") and another applied to my
 |resumé (btw, does HTML allow the standard &entity ref (w/o the
 |trailing ;) before whitespace?). My picture gallery demands a different
 |style, and individual gallery pages demand their own styles in addition to
 |*that*. Multiple stylsheet inclusion would be much easier to implement
 |than one huge stylesheet and BODY CLASSes (assuming we could coerce
 |html-wg into allowing those.) 
 |
 |How can I do this? I'd rather not have to copy the same stylesheet over
 |and over with minor modifications for each page...

That's what the word `cascading' in `cascading style sheets' means,
doesn't it? There are two ways:

1. Use multiple <LINK HREF="..." REL=STYLE>. In case they contain
   conflicting rules, those from later ones have priority.

2. Use @import "standard.style" at the top of the style sheet.

The second method will probably not be part of the first version of
the draft (`level 1'), but it will definitely be in the second.


Bert
-- 
                          Bert Bos                      Alfa-informatica
                 <bert@let.rug.nl>           Rijksuniversiteit Groningen
    <http://www.let.rug.nl/~bert/>     Postbus 716, NL-9700 AS GRONINGEN


References: