Reader style sheets and Author style sheets ...

55 views
Skip to first unread message

Kedar Mhaswade

unread,
Jun 22, 2008, 12:08:34 PM6/22/08
to Design the Web with CSS
Apologies if this has been asked before. I was not able to find out.

I understand that the "cascade" is impacted by the fact whether a
particular style's origin is "author" or "reader".

What I don't understand is how a reader specifies a style sheet. Can
someone please point me to an example that I can try out?

Regards,
Kedar

Devon

unread,
Jun 23, 2008, 11:42:16 AM6/23/08
to Design the Web with CSS
The term "reader" in this case means the browser that reads the HTML
from a URL. What you supply with your page, whether embedded, linked,
or imported, is always "author" style sheets. Ignore any references to
"reader" style sheets. Unless you are a browser developer, you have no
control over them.

Keep in mind that some browsers allow the user to disable CSS (as well
as Java, Javascript, Flash, etc). So, your page should degrade
gracefully when any of these are disabled. For example, using lists
(ul) when creating CSS menus. If CSS is disabled, there is still a
list of links and the page is still usable. Not as pleasant looking,
but still functional.

dcm

kedar mhaswade

unread,
Jun 23, 2008, 12:44:12 PM6/23/08
to css-d...@googlegroups.com
Thanks for your reply. But I guess I am not able to understand how reader style sheets are specified.
The author style sheets are specified in the <head> section of the document (or explicit use of
"style attribute on HTML elements) user agents receive.

But how are reader style sheets specified by a "reader" of the document? Is this a setting in every browser?
If yes, where is it, in Firefox 3?

- Kedar

Devon

unread,
Jun 23, 2008, 3:31:44 PM6/23/08
to Design the Web with CSS
I'm not aware of any browser that directly exposes a mechanism for the
reader to supply their own stylesheet. The closest I'm aware of is the
content tab of FF's options. It allows you to set preferred fonts,
minimum font sizes, and default colors. I suppose these could be
presented to the Gecko engine as a "reader" stylesheet, but I rather
doubt it as I'm not aware of a CSS notation for specifying a minimum
font size

There are, of course, plugins/add-ons that can supply this
functionality. (For example, Greasemonkey, http://www.greasespot.net/).

Are you asking as an author or a reader?

If you're asking as a reader wanting to control how sites are
presented in your browser, I'd suggest searching the Firefox add-ons
site for "stylesheet".

If you're asking as an author, you just have to accept that the user
may want to override your presentation. Ideally, pages should remain
navigable with no stylesheet loaded (you can use View>Page Style>No
Style in FF to test this. I'm not aware of an equivalent in IE). If
you're looking for a way to give your readers more options, the
standard does provide for alternate stylesheets. Just add additional
link tags with rel="alternate stylesheet" and a title giving a
descriptive name. (Example: see the source of http://www.w3.org/Style/.
Firefox lets you select one via View>Page Style. Again, I don't see
any menu entry for this in IE)

dcm

On Jun 23, 12:44 pm, "kedar mhaswade" <kedar.mhasw...@gmail.com>
wrote:
> Thanks for your reply. But I guess I am not able to understand how reader
> style sheets are specified.
> The author style sheets are specified in the <head> section of the document
> (or explicit use of
> "style attribute on HTML elements) user agents receive.
>
> But how are reader style sheets specified by a "reader" of the document? Is
> this a setting in every browser?
> If yes, where is it, in Firefox 3?
>
> - Kedar
>

kedar mhaswade

unread,
Jun 23, 2008, 6:34:57 PM6/23/08
to css-d...@googlegroups.com
Hmm. I thought of GreaseMonkey, but I thought that only installs "scripts" into your browser. Does that allow
you to specify a stylesheet as a "reader"?

Firefox addons like "themes" may be doing that.

Anyway, thanks for your answers. I don't fully understand it yet :(

- Kedar

Roy A.

unread,
Jun 23, 2008, 11:19:25 PM6/23/08
to Design the Web with CSS
On 22 Jun, 18:08, Kedar Mhaswade <kedar.mhasw...@gmail.com> wrote:
> Apologies if this has been asked before. I was not able to find out.
>
> I understand that the "cascade" is impacted by the fact whether a
> particular style's origin is "author" or "reader".

The term "reader" is from CSS1. In CSS2 is called "user":

"By default, rules in author style sheets have more weight than rules
in user style sheets. Precedence is reversed, however, for "!
important" rules."

<http://www.w3.org/TR/REC-CSS2/cascade.html#cascade>

> What I don't understand is how a reader specifies a style sheet. Can
> someone please point me to an example that I can try out?

If you make a stylesheet, with e.g.:

body, p { font-size: 32px !important }

and point your browser to that stylesheet, your (the users)
stylesheet will override the stylesheet from the web designer.

In opera you can specyfiy user stylesheet from Tools ->
Preference -> Advanced -> Content -> Style Options

In Microsoft's preinstalled browser, you can do it from
Tools -> Internet Options -> Accessibility

In Safari you can specify user stylesheet from
Safari -> Preferences -> Advanced -> Other

In Firefox you have to make a can of coffee, set on some
music and start searching for add-ons.

kedar mhaswade

unread,
Jun 24, 2008, 10:45:40 AM6/24/08
to css-d...@googlegroups.com
Great, exactly what I was looking for.

Thank you.
Reply all
Reply to author
Forward
0 new messages