473,378 Members | 1,280 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Alternate style sheets

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
5 2391
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Geoff Cox | last post by:
Hello, I publish some web pages using large fonts and would like to give the user the opportunity to print the pages using a smaller font. I believe that this is possible using different style...
3
by: Phil Thompson | last post by:
does it matter in which order i place different style sheets i.e. <link rel="stylesheet" type="text/css" media="screen" href="style/screen.css" /> <link rel="stylesheet" type="text/css"...
13
by: Toby A Inkster | last post by:
www.authoring.stylesheets] For ages I have provided links to alternate stylesheets from my pages as per W3C recommendations: <link rel="stylesheet" href="baz" type="text/css" title="Baz"...
12
by: relaxedrob | last post by:
Hi All! I have a page with with the following style information: <link rel="stylesheet" type="text/css" href="/eEmployment/eTech.css" /> <style type="text/css"> DIV.Application {...
1
by: Eric Lindsay | last post by:
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...
12
by: Jarno Suni | last post by:
I want a device to use styles given for media type handheld and not the styles given for media type screen, if the device supports media types handheld and screen. Is it possible without writing...
9
by: Radium | last post by:
Cascading Style Sheet is an extreme hazard to your privacy. It allows others on the internet to see your monitor and files. It allows them to copy images on your monitor to their computers. It...
1
by: mscertified | last post by:
Can anyone explain how references to style sheets work, I've exhausted looking in help, its all so confusing. I have three style sheets in my project under 'Style Sheets'. Only the first style...
5
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a machine running IIS 6.0. I just replaced the web.config and several aspx pages in the application and now the style sheets are not working. the images from the themes work but not the css...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.