Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Location
    India
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Persistent, preferred, and alternate styles

    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.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ah ha! the ol' style changer... i use one of these on my site. you need to use a little javascript aswell to change between style sheets...

    heres a handy link @ a list apart... with a complete script you are able to download at the end. wonderful.

    http://www.alistapart.com/stories/alternate/
    Last edited by redhead; 12-28-2002 at 06:53 PM.
    redhead

  • #3
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    A browser should offer the mechanism for you.

    In Mozilla or NS6+:
    View --> Use Style

    Opera 7:
    View --> Style

    And I think Konqueror might also provide an interface (can't remember). IE/Win does not however.

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts
    A browser should offer the mechanism ...... IE/Win does not however.
    unfortunatly the majority of poeple do use ie, which is why the script is needed.
    redhead

  • #5
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Originally posted by redhead
    unfortunatly the majority of poeple do use ie, which is why the script is needed.
    I was going to suggest that IE/Win really sucks as a browser, which is why you need to use a script...

    It is really unfortunate so many people use the awful piece of software.

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    The Netherlands
    Posts
    217
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes,Konqueror also support this;
    View>Use Stylesheet

    I totally agree with jkd,if people used a decent useragent (i.e. Mozilla,Opera,Konqueror) then you wouldn't have to waste your time on making such scripts.

  • #7
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Originally posted by Bosko

    I totally agree with jkd,if people used a decent useragent (i.e. Mozilla,Opera,Konqueror) then you wouldn't have to waste your time on making such scripts.
    Yeah it is sad. IE should be hit by a bus. (if that were even possible).
    OracleGuy

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry. i only provided a link in answer to a question. i did not mean to start another whole IE/ Moz argument.
    redhead

  • #9
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Originally posted by redhead
    sorry. i only provided a link in answer to a question. i did not mean to start another whole IE/ Moz argument.
    Not really an argument... seems kind of one-sided at the moment.

  • #10
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's not one sided at all - there are a whole host of business and interoperability reasons why IE is a great browser.

    And lots of technical and standards-support reasons why it both sucks and blows at the same time.

    In the words of Obsidian - Choose Your Fate


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •