codefox
12-28-2002, 04:23 PM
I just read about persistent, preferred and alternate stylesheets in the html4.01 specification. It says:
HTML allows authors to associate any number of external style sheets with a
document. The style sheet language defines how multiple external style sheets
interact (for example, the CSS "cascade" rules).
Authors may specify a number of mutually exclusive style sheets called alternate
style sheets. Users may select their favorite among these depending on their
preferences. For instance, an author may specify one style sheet designed for small
screens and another for users with weak vision (e.g., large fonts). User agents
should allow users to select from alternate style sheets.
The author may specify that one of the alternates is a preferred style sheet. User
agents should apply the author’s preferred style sheet unless the user has selected
a different alternate.
Authors may group several alternate style sheets (including the author’s preferred
style sheets) under a single style name. When a user selects a named style, the
user agent must apply all style sheets with that name. User agents must not apply
alternate style sheets with a different style name. The section on specifying external
style sheets [p.191] explains how to name a group of style sheets.
Authors may also specify persistent style sheets that user agents must apply in
addition to any alternate style sheet.
I have a preferred stylesheet which is applied for 800x600 screens, an alternate stylesheet for 1024x768 screens, and a persistent one with declarations common to all screens. How do I let the user select a stylesheet?
Thanks.
HTML allows authors to associate any number of external style sheets with a
document. The style sheet language defines how multiple external style sheets
interact (for example, the CSS "cascade" rules).
Authors may specify a number of mutually exclusive style sheets called alternate
style sheets. Users may select their favorite among these depending on their
preferences. For instance, an author may specify one style sheet designed for small
screens and another for users with weak vision (e.g., large fonts). User agents
should allow users to select from alternate style sheets.
The author may specify that one of the alternates is a preferred style sheet. User
agents should apply the author’s preferred style sheet unless the user has selected
a different alternate.
Authors may group several alternate style sheets (including the author’s preferred
style sheets) under a single style name. When a user selects a named style, the
user agent must apply all style sheets with that name. User agents must not apply
alternate style sheets with a different style name. The section on specifying external
style sheets [p.191] explains how to name a group of style sheets.
Authors may also specify persistent style sheets that user agents must apply in
addition to any alternate style sheet.
I have a preferred stylesheet which is applied for 800x600 screens, an alternate stylesheet for 1024x768 screens, and a persistent one with declarations common to all screens. How do I let the user select a stylesheet?
Thanks.