468,110 Members | 1,559 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,110 developers. It's quick & easy.

Naming and organizing style sheets

Are there any guidelines or conventions for how to organize the
preferred and alternate style sheets for a site, sheets for
different media, and what titles to give them in the
<link rel="(alternate )stylesheet" title="..." ... />
element?

For example:

Are there user agents that have problems with characters like space or
apostrophe in the title? Are there user agents that can be configured
to e.g. prefer sheets with a name "simple" in them, so it's a good idea
to use separate and common words?

Should I have one complete and titled sheet per media type or "skin", or
factor out common elements to a common style sheet which is used in
addition to the more specific ones?

I expect to have users use the same sheet(s) for the entire site and
just use different markup for different types of documents, unless
someone says that's a bad idea.

--
Hallvard
Jul 1 '06 #1
2 1747
On Sat, 01 Jul 2006 23:46:45 +0200, Hallvard B Furuseth
<h.**********@usit.uio.nowrote:
Are there any guidelines or conventions for how to organize the
preferred and alternate style sheets for a site, sheets for
different media, and what titles to give them in the
<link rel="(alternate )stylesheet" title="..." ... />
element?
Not that I'm aware of. Not surprising, as the number of browsers that do
something remotely useful with alternative stylesheets is low. The feature
was dropped from Firefox 1 because it was deemed useless in its then
current state. Main obstacle: no way to 'set' an alternative style for a
complete website.
For example:

Are there user agents that have problems with characters like space or
apostrophe in the title?
No. On for example http://www.w3.org/Style/ , the alternative stylesheets
contain spaces and + signs.
Are there user agents that can be configured
to e.g. prefer sheets with a name "simple" in them, so it's a good idea
to use separate and common words?
No. The style sheet title attribute is (and should) be handled as one
opaque string by browsers.
Should I have one complete and titled sheet per media type or "skin",
You really shouldn't mix alternate stylesheets with media stylesheets. For
specific styles for specific media, use the media attribute in HML or the
@media rule in the CSS - and don't set the title attribute on LINKed
media-specific stylesheets. You don't want the user having to select a
print stylesheet manually before printing (for which browsers don't have
UI anyway).
or factor out common elements to a common style sheet which is used in
addition to the more specific ones?
That saves a few bytes and centralizes your design a bit, can't hurt.
I expect to have users use the same sheet(s) for the entire site and
just use different markup for different types of documents, unless
someone says that's a bad idea.

--
Opera 9: your web, your choice.
http://my.opera.com/Rijk/

Rijk van Geijtenbeek
Jul 3 '06 #2
Thanks, Rijk.

--
Hallvard
Jul 4 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Phil Thompson | last post: by
3 posts views Thread by Jamie | last post: by
10 posts views Thread by Allan Ebdrup | last post: by
12 posts views Thread by Jarno Suni | last post: by
9 posts views Thread by Radium | last post: by
5 posts views Thread by Ed Jay | last post: by
1 post views Thread by mscertified | last post: by
5 posts views Thread by =?Utf-8?B?SmVycnkgQw==?= | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.