![]() The following example uses a persistent, preferred, and alternate style sheet, allowing the visitor to customise the look of the site to their taste.īy providing persistent, preferred, and alternate style sheets with a style switching form, visitors have the opportunity to combine the scripts to add more flexibility on how they customise your pages. Like preferred style sheets, alternate style sheets may be grouped by giving them the same title. An alternate relationship is specified with a rel attribute value of, "alternate stylesheet", and a title attribute is also provided. If more than one group of preferred style sheets are specified, the first group will take precedence over the other groups.Īn alternate style sheet is one that may be selected by the visitor as an alternative to the preferred style sheet. The preferred style sheets will be grouped, and enabled and disabled together. You may specify more than one preferred style sheet by specifying the same title for each. A preferred relationship is specified with a rel attribute value of, "stylesheet", and a title attribute is also provided. ![]() The relationship is specified with a rel attribute value of, "stylesheet", and no title attribute is provided.Ī preferred style sheet is enabled by default, but may be switched by the user for an alternate style sheet. If the document has more than one style sheet associated with it, the basic rules may be placed in this style sheet. If the rules for a document are contained in a single style sheet, then this is the way you will link to the style sheet. Before we examine the code, we'll look at how style sheets are linked to a document as persistent, preferred, and alternative style sheets.Ī persistent style sheet is always enabled. We decided to incorporate Jim's ideas into switchable style sheets, for maximum flexibility. A List Apart has two excellent scripts illustrating style sheet switching in JavaScript by Paul Sowden, and style sheet switching in PHP by Chris Clark. There are several published scripts for dealing with style sheet switching. As we're likely to be stuck with the current version of Internet Explorer as the most common browser for at least the next three years, we can improve usability by providing a mechanism for our visitors to customise their experience. In an ideal world, we wouldn't have to resort to these measures. As not all browsers support style sheet switching, some content developers provide their own mechanism for the style sheets to be changed. Internet Explorer, often quoted as being used by over 95% of surfers, does not provide a mechanism to switch style sheets. Browsers such as Gecko based browsers allow the user to choose which style they wish to use through the menu system. Style sheet switching is a mechanism provided by modern browsers that allow the user to choose between style sheets provided by the author. ![]() Discussing the idea further, we investigated ways that this technique could be incorporated into style sheet switchers.Ī Russian translation for this artucle has kindly been provided by Everycloud. Jim's ideas adequately deal with our initial reservations. Jim came up with the idea of providing a more flexible interface that allows visitors to select relative sizes for fonts, and a choice of foreground and background colour combinations using a server side script. They're usually implemented as fixed units, for example 9px or 12px, which actually hinders those that do know how to use their user agents, and are typically too limited in the choices they provide.Lots of sites that use these types of features implement them as icons, which get overlooked by users that would benefit from them. ![]() Most scripts are written in JavaScript, and so rely on the client having scripting capabilities.Most modern browsers allow the text size to be changed easily through the browser. Educating users how to use their particular user agent is the ideal, such as resizing text.We agreed we had reservations over their use for the following reasons. During a recent discussion with Jim Byrne of the Making Connections Unit, we pondered over the usefulness of scripts that allow visitors to change their preferences. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |