W3C home > Mailing lists > Public > public-html@w3.org > July 2016

Re: Preferred and alternate style sheets

From: Chaals McCathie Nevile <chaals@yandex-team.ru>
Date: Wed, 06 Jul 2016 12:32:39 +0200
To: "shkolnic10 shkolnic10" <shkolnic10@yandex.ru>, 조은 <apes0123@gmail.com>
Cc: public-html@w3.org
Message-ID: <op.yj6cwpbms7agh9@widsith.local>
On Wed, 06 Jul 2016 08:24:47 +0200, 조은 <apes0123@gmail.com> wrote:

> hi, maybe HTML5.1 Rendering Section[1] will help you
> that section are introduce many CSS-like suggestions for HTML5.1

But maybe not.

The way to attach a preferred stylesheet is described in  
https://w3c.github.io/html/links.html#link-type-stylesheet in the latest  
draft, the formal current standard is  
https://www.w3.org/TR/html5/links.html#link-type-stylesheet

They are pretty much the same.

Roughly, a "preferred stylesheet" is linked with an element

<link rel="stylesheet" href="…"

in the head, or is included in a style element in the document itself. and  
an alternate is linked using

<link rel="stylsheet alternate" href="…"

There are some other things that come into play. Using media queries it is  
possible to express preferences in a more detailed way, within a single  
stylesheet.

To get more detailed: In practice, you have a set of style rules, that can  
come from multiple places, including linked CSS files, style elements in  
the document, style attributes, or less commonly being added through  
javascript.

What you call a "stylesheet" might be the current applicable set of rules,  
or a single file.

Selecting between styles should be possible in a user agent. The most  
common way to do that in practice is using a developer tool, or a browser  
extension that manipulates the styles. User agents generally don't have  
very friendly support - and messing around with styles is difficult  
because modern stylesheets are often very complex, with multiple  
interdependencies.

Hope that helps a bit

cheers

Chaals

> [1]www.w3.org/TR/html51/rendering.html  
> <http://www.w3.org/TR/html51/rendering.html>
>
> Thanks.
>
>


-- 
Charles McCathie Nevile - web standards - CTO Office, Yandex
  chaals@yandex-team.ru - - - Find more at http://yandex.com
Received on Wednesday, 6 July 2016 10:33:16 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 6 July 2016 10:33:16 UTC