473,396 Members | 1,995 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,396 software developers and data experts.

Multiple linked stylesheets

Having just answered a question about multiple linked stylesheets, I
thought I'd have a look at browser support.

There's a quick test page here:

http://www.porjes.com/ms/

I wrote it according to my understanding of:

http://www.w3.org/TR/html401/present....html#h-14.3.2

Mozilla works as I expected. Opera sometimes works as I expect (ie
pasting the url into the nav bar & hitting return works until reload).
IE6 seems clueless.

Any thoughts? Have I made a mistake anywhere?
Jul 20 '05 #1
14 2565
In article <MP************************@news.CIS.DFN.DE>,
po****@spamcop.net says...
Having just answered a question about multiple linked stylesheets, I
thought I'd have a look at browser support.

There's a quick test page here:

http://www.porjes.com/ms/

I wrote it according to my understanding of:

http://www.w3.org/TR/html401/present....html#h-14.3.2

Mozilla works as I expected. Opera sometimes works as I expect (ie
pasting the url into the nav bar & hitting return works until reload).
IE6 seems clueless.

Just noticed a small cock-up, now fixed. Opera now works as expected,
and applies alternate stylesheets. IE6 picks up the preferred sheet
fine, but obviously won't do alternate without javascript.
Jul 20 '05 #2
"Jacqui or (maybe) Pete" <po****@spamcop.net> wrote in message
news:MP************************@news.CIS.DFN.DE...
Yeah, I think it's pretty confusing. There are 'preferred',
'persistent', and 'alternate' stylesheets depending on the title and
rel. Note that two stylesheets can have the same title in which case
they should both apply. .... The idea behind this is that you have one preferred stylesheet and a few
alternate ones that the readers can select (which they can, given a
sufficiently advanced browser or a touch of javascript).


Upon further reading, the part that is really confusing is that there are
really only two types (not three): persistant and alternate. 'Preferred' is
a subtype of alternate (i.e., it *is* an alternate). The ListApart article
is misleading. The W3C recommendation is more clear. Since alternate
stylesheets are mutually exclusive, you can only have one (or one named
group of sheets) at a time. =(

This causes several problems for me, unless I'm just thinking about this all
wrong. I'm working on a site with 6 different sheets (2 persistant [one for
screen, one for print], 1 alternate for largefonts, and 3 alternates for
'skins'). I would like the largefonts sheet to work in conjunction with any
of the skins, but since they're all alternate sheets, I can apparently only
have one at a time. That sucks.

What should happen (at least what I want to happen) is that you come to the
site and get the 'normal' layout (the persistant sheet and skin #1
[preferred alternate] combined). If you're visually impaired, you could
ideally select "largefonts" and still keep skin #1. From there, you could
choose skin #2 or #3 while still keeping largefonts (the largefonts sheet
supercedes the persistant sheet for font sizes).

What's happening in reality, at least for now, is that if you choose
largefonts, you lose the skin, and/or vice versa.

Does anyone know a way around this? I've already thought about grouping
skins together with largefonts, but that multiplies the number of user
options that they have to wade through - (skin #1 normal, skin #1
largefonts, skin #2 normal, skin #2 largefonts, etc.)

It would be nice to just present the user with either normal or largefonts,
and their choice of skin. In other words, it would be nice if the W3C would
take away the "mutually exclusive" rule, and let you stack alternate sheet
upon alternate sheet ad infinitum (or ad nauseum). =)

-- Richard

Jul 20 '05 #3
In article <MP************************@news.CIS.DFN.DE> in
comp.infosystems.www.authoring.stylesheets, Jacqui or (maybe) Pete
<po****@spamcop.net> wrote:
Having just answered a question about multiple linked stylesheets, I
thought I'd have a look at browser support.

There's a quick test page here:

http://www.porjes.com/ms/


Thanks! It's something I keep meaning to do, because I want to
switch _print_ stylesheets. Now you've done the legwork for me and I
can just leech off your hard work. <grin>

Thanks also for the references to
http://www.alistapart.com/stories/alternate/
and
http://www.w3.org/TR/html401/present....html#h-14.3.2

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #4
In article <MP************************@news.CIS.DFN.DE> in
comp.infosystems.www.authoring.stylesheets, Jacqui or (maybe) Pete
<po****@spamcop.net> wrote:
wrote it according to my understanding of:

http://www.w3.org/TR/html401/present....html#h-14.3.2


That spec says in part:

The preferred style sheet may also be specified with HTTP
headers. The above META declaration is equivalent to the
HTTP header:
Default-Style: "compact"

Do any user agents actually pay attention to a stylesheet preference
in HTTP headers?

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #5
In article <gw*******************@rwcrnsc51.ops.asp.att.net >,
br***@wfcr.org.invalid-remove-this-part says...
Jacqui or (maybe) Pete wrote:
Having just answered a question about multiple linked stylesheets, I
thought I'd have a look at browser support.

....

http://www.porjes.com/ms/


Might be helpful to include links to the stylesheets in the document,
so one can look and see if the styles are being loaded properly. Or


Done. I've included the relevant code in the document and made the link
lines links (if you see what I mean!).
Jul 20 '05 #6
In article <bf**********@nnrp.atgi.net>, rb*****@csaNOSPAMreno.org
says...
"Jacqui or (maybe) Pete" <po****@spamcop.net> wrote in message
news:MP************************@news.CIS.DFN.DE...
....
The idea behind this is that you have one preferred stylesheet and a few
alternate ones that the readers can select (which they can, given a
sufficiently advanced browser or a touch of javascript).


Upon further reading, the part that is really confusing is that there are
really only two types (not three): persistant and alternate. 'Preferred' is
a subtype of alternate (i.e., it *is* an alternate). The ListApart article
is misleading. The W3C recommendation is more clear. Since alternate
stylesheets are mutually exclusive, you can only have one (or one named
group of sheets) at a time. =(


Agreed. The really bad news is that I think you now know as much about
this as anyone does, so you're pretty much on your own from here on
in...
This causes several problems for me, unless I'm just thinking about this all
wrong. I'm working on a site with 6 different sheets (2 persistant [one for
screen, one for print], 1 alternate for largefonts, and 3 alternates for
'skins'). I would like the largefonts sheet to work in conjunction with any
of the skins, but since they're all alternate sheets, I can apparently only
have one at a time. That sucks.

What should happen (at least what I want to happen) is that you come to the
site and get the 'normal' layout (the persistant sheet and skin #1
[preferred alternate] combined). If you're visually impaired, you could
ideally select "largefonts" and still keep skin #1. From there, you could
choose skin #2 or #3 while still keeping largefonts (the largefonts sheet
supercedes the persistant sheet for font sizes).

In this particular instance I think you'd perhaps be better to just
include instructions on how to change font size in various popular
browsers (eg IE6 responds to control-mouse-scroll).

In the general case I think you'll need some server-side scripting. It's
not too hard, see:

http://porjes.com/bruciebugs/bugs.php

for an example. It actually allows people to bookmark different styles
of the page so you don't even need cookies (there are a few other bits
of genius in there, too).

Note that this is just a copy of brucie's original, no longer on his
site - so I trust he doesn't mind me posting a link to this copy.
Jul 20 '05 #7
In article <MP************************@news.odyssey.net>,
th************@fastmail.fm says...
In article <MP************************@news.CIS.DFN.DE> in
comp.infosystems.www.authoring.stylesheets, Jacqui or (maybe) Pete
<po****@spamcop.net> wrote:
wrote it according to my understanding of:

http://www.w3.org/TR/html401/present....html#h-14.3.2


That spec says in part:

The preferred style sheet may also be specified with HTTP
headers. The above META declaration is equivalent to the
HTTP header:
Default-Style: "compact"

Do any user agents actually pay attention to a stylesheet preference
in HTTP headers?

Yeah - I was pretty startled to read that.

Some discussion here: http://bugzilla.mozilla.org/show_bug.cgi?id=3248
but I can't really make out whether they fixed it or not.

In fact there seems to be some doubt as to whether it's an http standard
or not, and I can't believe there's any chance of IE6 supporting it.
Jul 20 '05 #8
On Wed, 16 Jul 2003 14:21:35 -0700, "Richard Barnet"
<rb*****@csaNOSPAMreno.org> wrote:
What should happen (at least what I want to happen) is that you come to the
site and get the 'normal' layout (the persistant sheet and skin #1
[preferred alternate] combined). If you're visually impaired, you could
ideally select "largefonts" and still keep skin #1. From there, you could
choose skin #2 or #3 while still keeping largefonts (the largefonts sheet
supercedes the persistant sheet for font sizes).

What's happening in reality, at least for now, is that if you choose
largefonts, you lose the skin, and/or vice versa.

Does anyone know a way around this? I've already thought about grouping
skins together with largefonts, but that multiplies the number of user
options that they have to wade through - (skin #1 normal, skin #1
largefonts, skin #2 normal, skin #2 largefonts, etc.)

It would be nice to just present the user with either normal or largefonts,
and their choice of skin.


May I suggest that anyone who has impaired vision (or a monitor with a
tiny dot pitch) has probably already set their font size to something
they can read, and that your largefonts stylesheet is superfluous? If
you think the user might need some help setting his/her text size, you
might like to have a look at my solution (see sig).

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #9
In article <9e********************************@4ax.com> in
comp.infosystems.www.authoring.stylesheets, Stephen Poley
<sb*****@xs4all.nl> wrote:
If
you think the user might need some help setting his/her text size, you
might like to have a look at my solution (see sig).
http://www.xs4all.nl/~sbpoley/webmatters/


I did, and the first paragraph there should be chiseled in the
foreheads of every "Web designer":

"When I first started putting this site together, I not unnaturally
had a look around at other sites on the web, and borrowed ideas from
them. As time has gone on however, I have gradually come to the
realisation that this is a very bad idea. Unless one is
exceptionally lucky in the sites one looks at, one is likely to
learn more bad habits than good."

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #10
"Lauri Raittila" <la***@raittila.cjb.net> wrote in message
news:MP************************@news.cis.dfn.de...
> Try setting persistant style after preferred.


Actually, I believe persistant sheets should always be linked before
alternates.
Nope, that's *exactly* what's supposed to happen, according to the spec - and that's my problem as well. =(


Persistant stylesheets should always be added. Maybe you are confusing
them with preferred stylesheets?


Sorry, yes, I misread her post. You're right. (It's too early in the
morning.)

-- Richard


Jul 20 '05 #11
In article <MP************************@news.cis.dfn.de>,
la***@raittila.cjb.net says...
In article <Pa***********************@newssvr10.news.prodigy. com>,
Richard Barnet wrote:

"Jacqui or (maybe) Pete" <po****@spamcop.net> wrote in message
news:MP************************@news.CIS.DFN.DE...
>
Hmmm. Except that the persistent stylesheets aren't being applied when
the alternate ones are active. Presumably I've made a mistake
somewhere?

No, I think that is OK. Works OK on O7.2b1. What browser is the problem?


You're right, it's OK in 7.2b. Mozilla 1.5b and IE6 got it wrong.
Try setting persistant style after preferred.


Yep - that fixes it for Mozilla (web page updated).

Mozilla's also pretty stupid about reloading pages, or going to another
page and coming back, which makes alternate sheets largely useless
unless some scripting is used to allow the user to set permanent
preferences.

....
Jul 20 '05 #12
On Thu, 17 Jul 2003 12:10:41 -0700, "Richard Barnet"
<rb*****@csaNOSPAMreno.org> wrote:
"Stephen Poley" <sb*****@xs4all.nl> wrote in message
news:9e********************************@4ax.com.. .

May I suggest that anyone who has impaired vision (or a monitor with a
tiny dot pitch) has probably already set their font size to something
they can read, and that your largefonts stylesheet is superfluous? If
you think the user might need some help setting his/her text size, you
might like to have a look at my solution (see sig).
That's a great idea, actually - and from experience I tend to agree.
This doesn't however, cover all the bases, though. If the user is at
their own computer, you're probably right. What happens if they go to
someone else's computer, though, like the library or a friend's house
that doesn't want all the fonts 'messed up'


Normally speaking it would only be a moment to change the settings, and
then change them back again at the end. And unless they are only going
to look at *your* site (and a perhaps a handful like it) they would need
to do that anyway.
(or like the library - has
the settings disabled so people can't change them)?


Is that an actual situation? I haven't met that one before. But
presumably they wouldn't then allow stylesheet selection either? (Well,
unless you go the Javascript route - but is Javascript enabled in that
situation?)

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #13
Stephen Poley wrote:
May I suggest that anyone who has impaired vision (or a monitor
with a tiny dot pitch) has probably already set their font size
to something they can read, and that your largefonts stylesheet
is superfluous? If you think the user might need some help
setting his/her text size, you might like to have a look at my
solution (see sig).
If the user is at their own computer, you're probably right.
What happens if they go to someone else's computer, though, like
the library or a friend's house that doesn't want all the fonts
'messed up'


Normally speaking it would only be a moment to change the settings,
and then change them back again at the end. And unless they are
only going to look at *your* site (and a perhaps a handful like it)
they would need to do that anyway.
(or like the library - has the settings disabled so people can't
change them)?


Is that an actual situation?


Yes. Libraries sometimes disable the prefs menu to avoid having
people muck about too much. I'd prefer if they had a log-on routine
that copied a config from a safe location, overwriting any changes
done previously.
But presumably they wouldn't then allow stylesheet selection
either?
Likely.
(Well, unless you go the Javascript route - but is Javascript
enabled in that situation?)


Oddly enough, on the library computers I've used, js was enabled (to
the best of my recollection).

--
Brian
follow the directions in my address to email me

Jul 20 '05 #14
"Brian" <us*****@mangymutt.com.invalid-remove-this-part> wrote in
message news:LbXRa.92147$Ph3.10917@sccrnsc04...
(or like the library - has the settings disabled so people can't
change them)?


Is that an actual situation?


Yes. Libraries sometimes disable the prefs menu to avoid having
people muck about too much. I'd prefer if they had a log-on routine
that copied a config from a safe location, overwriting any changes
done previously.
But presumably they wouldn't then allow stylesheet selection
either?


Likely.
(Well, unless you go the Javascript route - but is Javascript
enabled in that situation?)


Oddly enough, on the library computers I've used, js was enabled (to
the best of my recollection).


While JS and/or cookies being enabled is not always guaranteed, I still
prefer to add a few simple JS and cookie functions to pages to give the
user choices *right on the site*, since you can't always rely on the
browser environment in all situations. I know it's no guarantee, but
it's "better" than only relying on one method and not having a backup
method (and even using JS and cookies doesn't interfere with the
'normal' browser interface functions in a 'normal' computing
environment - it's only enhances the site and give the user even more
options).

Giving the user more options can only mean a site is more flexible (and
accessible) than those sites that don't. A all-too-typical example are
just regular old alternate stylesheets. Since I primarily use IE6 in
everyday use (and only use the others for testing - personal
preference), I've run into way too many sites that extol the virtues of
switching stylesheets (but only for "modern" browsers [i.e., Mozilla,
Firebird, Safari, Opera]. That's nice, but they've just rendered their
site(s) inaccessible to about 90% of web users (and probably confused
quite a few people that know they have the latest updates). Dumb.

I know why they do it - it's supposed to be an educational tool - to
'inform' the general masses that IE sucks and doesn't adhere to the
standards. Woo hoo - like that's news. It's just not the right way to
go about it - write an article for heaven's sake - don't exclude content
based upon a user's browser preference. This is exactly the opposite of
the very accessibility they're trying to preach.

The simple solution is to provide a cross-browser JS or server-side
routine (both have their strengths and weaknesses) that allow users to
switch stylesheets directly from the page. You've just please the IE
folks because now their supposedly antiquated browser now does the same
thing that the 'modern' ones do, and you've also just made it easier for
Moz/Opera/Safari users to quickly switch sheets without going into the
menus - thus eliminating the well-documented Moz bugs and (if setting
cookies) allows for cross-site preferences to be set and retained, not
just page-by-page settings.

[stepping down off of soapbox]

-- Richard
Jul 20 '05 #15

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

Similar topics

4
by: steve | last post by:
I'm new to XML, so pardon the stupid question. I've looked thru several books with not luck. All I want to do is associate one xml file with multiple xsl stylesheets. For example, if the user...
5
by: Laiverd.COM | last post by:
Currently working on a site that requires multiple different styles for all kind of things (tables, link colors etc.) and am suddenly ;-) wondering what would be the wise approach: have all these...
4
by: Carolyn Marenger | last post by:
Hey everyone, I am looking for your thoughts and opinions. Is it preferable to have one css file containing all the style information or break it up into multiple imported files for different...
5
by: Don G | last post by:
Is it possible to link multiple stylesheets to a single web page? I have an overall stylesheet for my entire site, but there are a few pages with a minor differences. I originally had these as...
3
by: spolsky | last post by:
hi, it is possible to apply multiple styles as shown in the following example. <STYLE TYPE="text/css"><!-- BODY { background-color:salmon; } P { margin-left:20px; } .clsCode {...
8
by: mscertified | last post by:
I have two stylesheet files, one is a standard file and one a custon file. They have no classnames in common. How do I specify that my page use both stylesheets? I tried Help and as usual could...
0
by: Kevin | last post by:
I would like to change the naming convention for my stylesheets so they include the version number of the release. Because the xml files that are created by the application may be read and created...
0
by: Kevin | last post by:
I would like to change the naming convention for my stylesheets so they include the version number of the release. Because the xml files that are created by the application may be read and created...
1
by: kevino | last post by:
I would like to change the naming convention for my stylesheets so they include the version number of the release. Because the xml files that are created by the application may be read and created...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.