By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,740 Members | 790 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,740 IT Pros & Developers. It's quick & easy.

Alternate style sheets

P: n/a
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 of each
alternative?
Does basic.css get downloaded each time the style is changed, or just
once (with the first view)?
Does it matter? - Is there another way? -
--
te****@ban.arg.nh
Email addy ROT13'd
Jul 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Tim
On Sun, 24 Apr 2005 01:15:27 +0000, User wrote:
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 of each alternative?
That's one of the things that I do.
Does basic.css get downloaded each time the style is changed, or just
once (with the first view)?
If the server and client are set up right, they fetch what they need once,
and use their cache. If they're set up badly, they may fetch over and
over, though I've not seen that. I have seen those that check whether
they should fetch it each time. Though, again, that seems due to poor
settings.

Even MSIE gets it half right. It only downloads the files it needs once
(i.e. your included one in several alternate stylesheets). But it does
download all of your stylesheets, even though it doesn't support using
alternate stylesheets.
Does it matter? - Is there another way?


Probably not, and yes. Though I don't think that anything is going to be
any better.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please delete some files yourself.

Jul 21 '05 #2

P: n/a
Tim wrote:
On Sun, 24 Apr 2005 01:15:27 +0000, User wrote:

If I want to provide alternate stylesheets (eg red.css, green.css),


The default Xaraya cms install, includes different theme style sheets,
they are all included, and are selected by an "on click" javascript
action when the colour button is clicked. If your user has js disabled
they will still get the default css.
Jul 21 '05 #3

P: n/a
User wrote:
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 of each
alternative?
Does basic.css get downloaded each time the style is changed, or just
once (with the first view)?
Does it matter? - Is there another way? -


You could use basic.css as a *persistent* style sheet, red.css as a
*preferred* style sheet and green.css as an *alternate* style sheet.

<link rel="stylesheet" type="text/css" href="basic.css">
<link rel="stylesheet" type="text/css" href="red.css" title="Red">
<link rel="alternate stylesheet" type="text/css" href="green.css"
title="Green">

14.3 External style sheets; "HTML 4.01 Specification";
W3C Recommendation; 24 December 1999;
<http://www.w3.org/TR/REC-html40/present/styles.html#h-14.3>

--
Steve

Everywhere is walking distance if you have the time. -Steven Wright
Jul 21 '05 #4

P: n/a
User wrote:
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 of each
alternative?
Does basic.css get downloaded each time the style is changed, or just
once (with the first view)?
Does it matter? - Is there another way? -


There is no sense in repeating the same declarations several times and
the download is only once, so it makes good sense. Since not all
browsers support alternate stylesheets, you may wish to consider another
method. With just a little script and only one stylesheet you can change
classes and effectively provide alternate styles rather than alternate
stylesheets. Here is an example:
http://www.home.golden.net/~richterf...4_Opera_1.html
Disregard the floating box which describes an Opera redraw bug.

--
Gus
Jul 21 '05 #5

P: n/a
In article <TY********************@golden.net>, gu********@netscape.net
says...
User wrote: <snip>
Does basic.css get downloaded each time the style is changed, or just
once (with the first view)?
Does it matter? - Is there another way? -

<snip> ... With just a little script and only one stylesheet you can change
classes and effectively provide alternate styles rather than alternate
stylesheets. Here is an example:
http://www.home.golden.net/~richterf...4_Opera_1.html
Disregard the floating box which describes an Opera redraw bug.

Thanks Gus, I'll study that. That Opera redraw bug is still there in
v8.0.
--
te****@ban.arg.nh
Email addy ROT13'd
Jul 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.