Alternate Stylesheets Considered Harmful (by me, for the time being)

T

Toby A Inkster

[Xposted, f'up to alt.html,comp.infosystems.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"
media="screen,projection" />
<link rel="alternate stylesheet" href="foo" type="text/css" title="Foo"
media="screen,projection" />
<link rel="alternate stylesheet" href="bar" type="text/css" title="Bar"
media="screen,projection" />

This morning I removed the alternate stylesheets, leaving only a
cookie-based stylesheet selector.

Why?

Simply because the current behaviour of all major CSS-supporting
browsers[1] is to preemptively download *all* linked stylesheets including
alternates when the page initially loads. Even Internet Explorer, which
doesn't even provide a mechanism to switch style sheets exhibits this
behaviour! In my case, this adds an extra 35KB to the initial[2] page
load.

Indeed some browsers[3] go even further and also download the background
images referenced in alternate stylesheets.

So until most browsers implement default style sheets sanely, I'm going
back to the cookie-based styling method.

</rant>

[1] Noticed this in Internet Explorer 5+, Mozilla 1.x, Opera 7.x, Safari
1.1 and Konqueror 3.1, although it probably effects others.
[2] 10KB page, 5KB default style sheet.
[3] Notably Konqueror, Safari.
 
M

m

Toby said:
This morning I removed the alternate stylesheets, leaving only a
cookie-based stylesheet selector.

Why?

Simply because the current behaviour of all major CSS-supporting
browsers[1] is to preemptively download *all* linked stylesheets including
alternates when the page initially loads. Even Internet Explorer, which
doesn't even provide a mechanism to switch style sheets exhibits this
behaviour!

Yeah, I also played with alistapart's javascript switcher which works
with IE, but decided it was also too much of a download, and really
a kind of kludge to patch the shortcomings of Internet Exploder.

The server side solution is attractive, except that you may be limiting
search engine participation. But I think you could have a default
page in normal (X)HTML, with buttons or links to generate the same page with
different style sheets with server side help. That way, the spider
shouldn't miss any actual content.
 
N

Nico Schuyt

m said:
The server side solution is attractive, except that you may be
limiting search engine participation. But I think you could have a
default
page in normal (X)HTML, with buttons or links to generate the same
page with different style sheets with server side help. That way,
the spider shouldn't miss any actual content.

Forgive me my ignorance, but does it matter which stylesheet is applied for
a search engine?
IMO the content is always the same for a spider.
Nico
 
M

Michael Wilcox

Nico Schuyt said:
Forgive me my ignorance, but does it matter which stylesheet is
applied for a search engine?
IMO the content is always the same for a spider.

It does not matter how the page looks when it's styled with CSS and has
proper structure. However, there may be problems when you improperly style a
web page with tables and the bot indexes info which isn't part of your
content. A search bot is ultimately looking for content.
 
M

m

Nico said:
Forgive me my ignorance, but does it matter which stylesheet is applied
for a search engine?
IMO the content is always the same for a spider.
Nico

No, I'm just saying that if you have a default page that's not *generated*,
then the bots are sure to get through. The bots lose nothing if there are
other generated pages (with the same content) that they can't (or won't) get
to.
 
P

PeterMcC

It does not matter how the page looks when it's styled with CSS and
has proper structure. However, there may be problems when you
improperly style a web page with tables and the bot indexes info
which isn't part of your content. A search bot is ultimately looking
for content.

There is talk of Google taking a greater interest in CSS files because of
the various CSS tricks - white-text-on-white-background, all the text as
<h1> but styled to look like body copy, and so on.

In these cases, CSS is used to deliver a page to the SE the spider with
words and emphasis that the human visitor doesn't experience.

Google say, "Make pages for users, not for search engines. Don't deceive
your users, or present different content to search engines than you display
to users." http://www.google.com/webmasters/guidelines.html
 
T

Toby A Inkster

Safalra said:
Toby A Inkster said:
[snip rant without <rant> tag]
</rant>

You rant does not validate:

Line 31, column 6: end tag for element "RANT" which is not open.

<!DOCTYPE rant [
<!ELEMENT rant O - (#CDATA) -- rant element has optional opening tag -->
]>
 
H

Harlan Messinger

m said:
Toby said:
This morning I removed the alternate stylesheets, leaving only a
cookie-based stylesheet selector.

Why?

Simply because the current behaviour of all major CSS-supporting
browsers[1] is to preemptively download *all* linked stylesheets including
alternates when the page initially loads. Even Internet Explorer, which
doesn't even provide a mechanism to switch style sheets exhibits this
behaviour!

Yeah, I also played with alistapart's javascript switcher which works
with IE, but decided it was also too much of a download, and really
a kind of kludge to patch the shortcomings of Internet Exploder.

The server side solution is attractive, except that you may be limiting
search engine participation.

In what way? By server-side solution, I assume you mean that the server
writes one set of LINK tags (or stylesheet PIs) unless a request parameter
indicates that a different one has just been selected by the user or a
session parameter indicates that the user had selected a different one in a
previous request. A spider might ignore style-selection links *on* the page
that have URL arguments, but I don't see why it would ignore the ordinary
page-to-page hyperlinks on the site.
But I think you could have a default
page in normal (X)HTML, with buttons or links to generate the same page with
different style sheets with server side help. That way, the spider
shouldn't miss any actual content.

Now you seem to be saying what I'm saying. But I don't see what distinction
you had in mind between this last server-side scenario and the one before
it.
 
M

m

In what way?
By server-side solution, I assume you mean that the server
writes one set of LINK tags (or stylesheet PIs) unless a request parameter
indicates that a different one has just been selected by the user or a
session parameter indicates that the user had selected a different one in
a previous request. A spider might ignore style-selection links *on* the
page that have URL arguments, but I don't see why it would ignore the
ordinary page-to-page hyperlinks on the site.

My concern is whether the spider will *go* to at least one page
of your content in the first place.

If a spider sees a link ending with something kinda like:
....pl?imgA=350:imgB=400:textA=550:textB=240
it may decide not to follow the link because the possible number of
combinations of such a generated page are unknowable in any practical way.

So, if you're going to generate various headers for a hunk of content
server side, you want to make sure you can get to at least one version of
the content without resorting to a link like the one above.
So I said:

This assures that the spider will go to at least one version of the
content.
 
N

Neal

Safalra said:
Toby A Inkster said:
[snip rant without <rant> tag]
</rant>

You rant does not validate:

Line 31, column 6: end tag for element "RANT" which is not open.

<!DOCTYPE rant [
<!ELEMENT rant O - (#CDATA) -- rant element has optional opening tag -->
]>

http://www.w3.org/TR/rant10/struct/global.html#h-2.7

"While the use of the opening RANT tag is not required, authors are
encouraged to include it to alert user agents of content which might be
too histrionic for adequate rendering. Agents are not required to render
contents of RANT. However, if they render RANT they may provide an
additional RANT element in response."

Of course, this section is merely informative.
 
J

Jukka K. Korpela

Harlan Messinger said:
By server-side solution, I assume you mean that the server
writes one set of LINK tags (or stylesheet PIs) unless a request
parameter indicates that a different one has just been selected - -

I thought the idea was to have a LINK element that refers to a server-
side script that generates a style sheet, using the query part of a
URL, or cookie settings, or both. The HTML document could be static;
just the style sheet would get generated dynamically.

I found the original posting somewhat shocking. I had not realized how
bad the situation with alternate style sheets is. But it seems fair to
say that they were a poorly formulated idea from the beginning, and the
implementations, or lack of them, are even worse.

(Crossposting to alt.html and c.i.w.a.s. restored. I don't think it's
useful to have one subthread in one group only. Then again, this
confusion confirms my observations: crossposting usually doesn't pay
off, even if you try to set f'ups meaningfully. Actually, I think I'm
not the only one with a newsreader set to ignore massively crossposted
articles, maybe with "massively" defined as '>3' or something.)
 
H

Harlan Messinger

Jukka K. Korpela said:
I thought the idea was to have a LINK element that refers to a server-
side script that generates a style sheet, using the query part of a
URL, or cookie settings, or both. The HTML document could be static;
just the style sheet would get generated dynamically.

Ahhhh. Though I don't see how *that* would deter search engines either.
 
M

Michael Rozdoba

Neal wrote:

[snip]
http://www.w3.org/TR/rant10/struct/global.html#h-2.7

"While the use of the opening RANT tag is not required, authors are
encouraged to include it to alert user agents of content which might be
too histrionic for adequate rendering. Agents are not required to render
contents of RANT. However, if they render RANT they may provide an
additional RANT element in response."

Of course, this section is merely informative.

I thought it had been superceeded? Last I read, RANT and associated
emotive tags have been deprecated in favour of cascading emotion maps.
Not that IE supports them yet, obviously.
 
M

Mark Parnell

On Tue, 27 Jan 2004 21:25:41 +0000, Michael Rozdoba
I thought it had been superceeded? Last I read, RANT and associated
emotive tags have been deprecated in favour of cascading emotion maps.
Not that IE supports them yet, obviously.

AIUI, it hasn't actually been deprecated, although there *is* now an
equivalent in CEM {emotion-family: rant;}. Apparently there is still
some discussion as to whether defining it as a rant is simply
presentational, or actually part of the content.
 
N

Neal

On Tue, 27 Jan 2004 21:25:41 +0000, Michael Rozdoba


AIUI, it hasn't actually been deprecated, although there *is* now an
equivalent in CEM {emotion-family: rant;}. Apparently there is still
some discussion as to whether defining it as a rant is simply
presentational, or actually part of the content.

<rant> markup is definitely meaningful. But you can style something to
make it appear like a rant. Another method is to use display-type: rant;

Oh, and the latest XHTML specs finally stipulate that the element <rant>
cannot contain itself.
 
S

Stephen Poley

On Tue, 27 Jan 2004 21:25:41 +0000, Michael Rozdoba


AIUI, it hasn't actually been deprecated, although there *is* now an
equivalent in CEM {emotion-family: rant;}. Apparently there is still
some discussion as to whether defining it as a rant is simply
presentational, or actually part of the content.

What's the CEM equivalent for <ALERT TYPE="coffee and cats">?
I can't access the spec at present - I keep getting HTTP
error 42: server has died laughing.
 
M

Michael Rozdoba

What's the CEM equivalent for <ALERT TYPE="coffee and cats">?
I can't access the spec at present - I keep getting HTTP
error 42: server has died laughing.

I imagine an expert will be along to give you the right answer. I'm not
at all sure.

However I do remember reading that CEM shouldn't be considered a drop in
replacement for the deprecated structural mark up. Learn to be able to
recite the full spec, cogitate on the inner meaning & eventually, if you
are chosen, you might reach an enlightened state whence it becomes clear
how your coffee and cats can be emotionally mapped in a far more
harmonious manner than was ever possible with the old mark up.

HTH
 
N

Neal

What's the CEM equivalent for <ALERT TYPE="coffee and cats">?
I can't access the spec at present - I keep getting HTTP
error 42: server has died laughing.

Meaning and presentation. If there is actual coffee and actual cats, use
the HTML as they are content coffee and contented cats.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top