Persistent, default and alternate styles

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eric Lindsay

    Persistent, default and alternate styles

    I am trying to understand the differences between and uses of
    persistent, default and alternate styles. I have read
    http://www.w3.org/TR/REC-html40/present/styles.html section 14.3.2 on
    specifying external style sheets in link using combinations of rel and
    using or not using the title attribute.

    I think I sort of understand rel="alternate stylesheet". It seems to be
    able to act something like the media="print" or media="handheld " or
    media="projecti on" Except it does not act automatically to produce the
    layout as defined. Instead, the user agent has to support it, and the
    user has to select the alternate style sheet. I can't find access in
    Safari. In Firefox, Page Style. In Opera, View, Style, and then a list
    of the Title given to each of the style sheets in the link to them.

    However the reference above says to name the alternate style sheet using
    the title attribute. Whereas at
    http://www.w3.org/TR/2002/CR-css3-me...ries-20020708/ there are
    examples of links to them without title attributes. So is it required
    or not? I would think it is required. I think this is supported by the
    use of title to indicate the difference between persistent and preferred
    style sheets.

    Moving to persistent vs preferred style sheets, most style sheets seem
    to be persistent. That is, the link has href="mystyle.c ss"
    rel="stylesheet " type="text/css" However most do not include the
    title="whatever ", so they are not preferred style sheets. So am I right
    in thinking a persistent style sheet is used when you expect that other
    style sheets (or styles) may also be used by the HTML document. And a
    preferred style sheet would be appropriate where you think it may be
    replaced entirely by some other style sheet?

    --
    Eric Lindsay's web sites, featuring Airlie Beach diving, sailing tourist area, Psion Epoc computers, Gegenschein Science fiction fanzine.

  • Garmt de Vries

    #2
    Re: Persistent, default and alternate styles

    Eric Lindsay wrote:[color=blue]
    > I am trying to understand the differences between and uses of
    > persistent, default and alternate styles.[/color]

    There's a good text on this at
    http://www.alistapart.com/articles/alternate/ (At least, the use of
    alternate stylesheets is explained quite clearly, I'll ignore the
    merits or shortcomings of the proposed JS).
    [color=blue]
    > So am I right
    > in thinking a persistent style sheet is used when you expect that other
    > style sheets (or styles) may also be used by the HTML document. And a
    > preferred style sheet would be appropriate where you think it may be
    > replaced entirely by some other style sheet?[/color]

    Yes, you're right.

    * Use a persistent stylesheet for style rules that you want to see
    applied at all times.
    * Use a preferred stylesheet for style rules that go on top of the
    persistent style, and that you propose as a default, but may be changed
    when the user selects one of the alternate stylesheets.
    * Use alternate stylesheets for styles that can replace the style given
    in the preferred stylesheet.

    You could imagine having a persistent stylesheet that describes the
    general layout of your page, a preferred stylesheet that declares
    colours and background images, and an alternate stylesheet that uses
    black and white only, and puts borders on certain elements. Note that
    you can break up one persistent, preferred or alternate "stylesheet "
    into several css files, provided you give them the same title.

    Example:

    <link rel="stylesheet " type="text/css" href="basiclayo ut.css" />
    <link rel="stylesheet " type="text/css" href="basicfont s.css" />
    <link rel="stylesheet " type="text/css" href="fancycolo urs.css"
    title="Merry" />
    <link rel="stylesheet " type="text/css" href="fancyback grounds.css"
    title="Merry" />
    <link rel="alternate stylesheet" type="text/css" href="b-w.css"
    title="Austere" />
    <link rel="alternate stylesheet" type="text/css" href="borders.c ss"
    title="Austere" />

    I'm not sure how alternate stylesheets are supposed to interact with
    stylesheets for different media, nor how they do interact in reality.
    I'd guess that the UA that is about to print a page would look only at
    the stylesheet links with the applicable media attributes ("print" or
    "all"), and determine which of these are persistent, preferred or
    alternate.

    --
    Garmt de Vries.

    Comment

    Working...