472,982 Members | 2,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,982 software developers and data experts.

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="projection" 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.css"
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?

--
http://www.ericlindsay.com
Dec 21 '05 #1
1 4291
Eric Lindsay wrote:
I am trying to understand the differences between and uses of
persistent, default and alternate styles.
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).
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?


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="basiclayout.css" />
<link rel="stylesheet" type="text/css" href="basicfonts.css" />
<link rel="stylesheet" type="text/css" href="fancycolours.css"
title="Merry" />
<link rel="stylesheet" type="text/css" href="fancybackgrounds.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.css"
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.

Dec 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: madsgormlarsen | last post by:
Hi I am making a html table builder, and would like every second row to be blue. So for that purpose I need a number that changes on every iteration of a while loop, for exampel so that a value...
5
by: User | last post by:
If I want to provide alternate stylesheets (eg red.css, green.css), is it better to put all the stuff that is common to both sheets in a separate css file (eg basic.css) and use @import at the top...
1
by: Marco Rispoli | last post by:
I am using this function to write a cookie: private static void SaveCookie(string CookieName, string CookieValue, bool Persistent) { HttpContext.Current.Response.Cookies.Value = CookieValue;...
0
by: Kepler | last post by:
I'm testing very basic FormsAuthentication and having trouble with non-persistent cookies. Once authenticated with a non-persistent cookie, if I leave the browser alone for 30 minutes,...
8
by: Alan J. Flavell | last post by:
What I was trying to do: to offer a default stylesheet, plus another small stylesheet which can be applied additionally to the default one. Preferably, the optional stylesheet should be initially...
2
by: viveklinux | last post by:
Hi, Have a FAQ page , where have many sets of questions and answers. The questions need to be a different colour / style and the answers different. Was wondering is there a easy way to do this...
0
by: robert | last post by:
I have noticed in .net 2 that when authenticating a user, setting the cookie using either redirectfromloginpage or setauthcookie, specifying true for the persistent parameter that the cookie is...
3
by: sanchita | last post by:
Hello everyone, I didn't get any response in "Security" forum hence posting here again. I am having problem with persistent cookies. Even after setting "CreatePersistentCookie" to true in...
9
by: mel | last post by:
Hi all, I need a persistent TCP connection with my web server over page reloads. This means that, even if the user goes to a different page (in my domain), I want to keep a TCP connection...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.