1 |
wakaba |
1.1 |
|
2 |
|
|
|
3 |
|
|
HTML and Style Sheets 22 Nov 1995 |
4 |
|
|
|
5 |
|
|
INTERNET DRAFT Bos, Raggett & Lie, |
6 |
|
|
Expires in six months World Wide Web Consortium |
7 |
|
|
|
8 |
|
|
HTML and Style Sheets |
9 |
|
|
|
10 |
|
|
<draft-ietf-html-style-00.txt> |
11 |
|
|
|
12 |
|
|
Status of this Memo |
13 |
|
|
|
14 |
|
|
This document is an Internet draft. Internet drafts are working |
15 |
|
|
documents of the Internet Engineering Task Force (IETF), its areas |
16 |
|
|
and its working groups. Note that other groups may also distribute |
17 |
|
|
working information as Internet drafts. |
18 |
|
|
|
19 |
|
|
Internet Drafts are draft documents valid for a maximum of six |
20 |
|
|
months and can be updated, replaced or obsoleted by other documents |
21 |
|
|
at any time. It is inappropriate to use Internet drafts as reference |
22 |
|
|
material or to cite them as other than as "work in progress". |
23 |
|
|
|
24 |
|
|
To learn the current status of any Internet draft please check the |
25 |
|
|
"lid-abstracts.txt" listing contained in the Internet drafts shadow |
26 |
|
|
directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), |
27 |
|
|
munnari.oz.au (Pacific Rim), ds.internic.net (US East coast) or |
28 |
|
|
ftp.isi.edu (US West coast). Further information about the IETF can |
29 |
|
|
be found at URL: http://www.ietf.org/ |
30 |
|
|
|
31 |
|
|
Distribution of this document is unlimited. Please send comments to |
32 |
|
|
the HTML working group (HTML-WG) of the Internet Engineering Task |
33 |
|
|
Force (IETF) at <html-wg@oclc.org>. Discussions of this group are |
34 |
|
|
archived at URL: http://www.acl.lanl.gov/HTML-WG/archives.html. |
35 |
|
|
|
36 |
|
|
This specification is also available via the Web in hypertext form |
37 |
|
|
as a Working Draft of the World Wide Web Consortium, see: |
38 |
|
|
http://www.w3.org/pub/WWW/TR |
39 |
|
|
|
40 |
|
|
Authors: |
41 |
|
|
Bert Bos <bert@w3.org>, |
42 |
|
|
Dave Raggett <dsr@w3.org>, |
43 |
|
|
Hekon Lie <howcome@w3.org> |
44 |
|
|
|
45 |
|
|
------------------------------------------------------------------------------ |
46 |
|
|
Abstract |
47 |
|
|
|
48 |
|
|
The HyperText Markup Language (HTML) is a simple markup language |
49 |
|
|
used to create hypertext documents that are portable from one |
50 |
|
|
platform to another. HTML documents are SGML documents with generic |
51 |
|
|
semantics that are appropriate for representing information from a |
52 |
|
|
wide range of applications. This specification extends HTML to |
53 |
|
|
provide support for rendering instructions expressed in separately |
54 |
|
|
specified notations. It is no longer necessary to extend HTML when |
55 |
|
|
new forms of rendering instructions are needed. Rendering |
56 |
|
|
instructions can be included with individual HTML elements to which |
57 |
|
|
they apply, or grouped together in the document head, or placed in |
58 |
|
|
|
59 |
|
|
Bos, Raggett & Lie Page 1 |
60 |
|
|
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
HTML and Style Sheets 22 Nov 1995 |
64 |
|
|
|
65 |
|
|
associated style sheets. This specification does not specify |
66 |
|
|
particular style sheet notations, leaving that to other |
67 |
|
|
specifications. |
68 |
|
|
|
69 |
|
|
------------------------------------------------------------------------------ |
70 |
|
|
Contents |
71 |
|
|
|
72 |
|
|
* Associating documents with style sheets ........................... 2 |
73 |
|
|
|
74 |
|
|
* Media Dependencies ................................................ 3 |
75 |
|
|
|
76 |
|
|
* The LINK Tag ...................................................... 3 |
77 |
|
|
|
78 |
|
|
* The STYLE Tag ..................................................... 4 |
79 |
|
|
|
80 |
|
|
* Common Attributes ................................................. 7 |
81 |
|
|
|
82 |
|
|
* The C tag ......................................................... 8 |
83 |
|
|
|
84 |
|
|
* User interface and user supplied style sheets |
85 |
|
|
|
86 |
|
|
* Deployment Issues ................................................. 9 |
87 |
|
|
|
88 |
|
|
* Performance Issues ............................................... 10 |
89 |
|
|
|
90 |
|
|
* References ....................................................... 11 |
91 |
|
|
|
92 |
|
|
------------------------------------------------------------------------------ |
93 |
|
|
Associating HTML documents with Style Sheets |
94 |
|
|
|
95 |
|
|
There are several approaches for associating HTML documents with |
96 |
|
|
separate style sheets: |
97 |
|
|
|
98 |
|
|
User applied style sheets |
99 |
|
|
The user agent may provide the means for users to select and |
100 |
|
|
apply style sheets. |
101 |
|
|
|
102 |
|
|
|
103 |
|
|
|
104 |
|
|
Implicit associations |
105 |
|
|
The appropriate style sheet may be implied by the URL or other |
106 |
|
|
information describing the resource. This approach allows style |
107 |
|
|
sheets to be retrieved in advance of, or at the same time as, |
108 |
|
|
the HTML document itself. Implicit associations are not defined |
109 |
|
|
in this report. |
110 |
|
|
|
111 |
|
|
|
112 |
|
|
|
113 |
|
|
Explicit associations |
114 |
|
|
The author can specify one or more alternative style sheets for |
115 |
|
|
an HTML document using one of the methods described below. |
116 |
|
|
|
117 |
|
|
|
118 |
|
|
|
119 |
|
|
Bos, Raggett & Lie Page 2 |
120 |
|
|
|
121 |
|
|
|
122 |
|
|
|
123 |
|
|
HTML and Style Sheets 22 Nov 1995 |
124 |
|
|
|
125 |
|
|
In HTML it is also possible to put style sheets in-line in the |
126 |
|
|
document. HTML is extended with a new element and a new attribute |
127 |
|
|
(both called STYLE), as described below. No matter how style sheets |
128 |
|
|
are applied, the user should be made aware that a particular style |
129 |
|
|
is in force and should have the option of turning it off. |
130 |
|
|
|
131 |
|
|
------------------------------------------------------------------------------ |
132 |
|
|
Media Dependencies |
133 |
|
|
|
134 |
|
|
Styles may often be designed for a restricted range of media, e.g. |
135 |
|
|
for graphical user interfaces with scalable fonts and millions of |
136 |
|
|
colors; for A4 paper media; for speech output; or for simple |
137 |
|
|
terminals with fixed pitch single font and 80x24 character displays. |
138 |
|
|
This proposal doesn't provide an explicit means to state the |
139 |
|
|
conditions under which a given style sheet is applicable. |
140 |
|
|
|
141 |
|
|
Style sheet notations may themselves provide support for media |
142 |
|
|
dependencies. Another approach is to use a generic URL to reference |
143 |
|
|
a style sheet, and to make the binding to a specific URL according |
144 |
|
|
to the media required. This will be described in a separate working |
145 |
|
|
draft. |
146 |
|
|
|
147 |
|
|
------------------------------------------------------------------------------ |
148 |
|
|
Using the HTML LINK element |
149 |
|
|
|
150 |
|
|
In HTML, the LINK element is used to create a typed hyperlink |
151 |
|
|
between the document and some other resource. The REL attribute |
152 |
|
|
defines the type of the link. With REL=stylesheet, the LINK element |
153 |
|
|
can also be used to link to a style sheet. |
154 |
|
|
|
155 |
|
|
Authors can use LINK elements to offer readers a choice of style |
156 |
|
|
sheets, e.g: |
157 |
|
|
|
158 |
|
|
<LINK TITLE="Traditional" REL=stylesheet HREF="old.style"> |
159 |
|
|
<LINK TITLE="Modern" REL=stylesheet HREF="modern.style"> |
160 |
|
|
<LINK TITLE="Wacky" REL=stylesheet HREF="wacky.style"> |
161 |
|
|
<TITLE>ACME Widgets Corp</TITLE> |
162 |
|
|
|
163 |
|
|
<H1>ACME Widgets Corp</H1> |
164 |
|
|
<P>If your browser supports style sheets, try our new look |
165 |
|
|
in traditional, modern and wacky styles. |
166 |
|
|
|
167 |
|
|
... |
168 |
|
|
|
169 |
|
|
Another approach is to use a generic URL for a LINK which maps to a |
170 |
|
|
set of alternative style sheets. A separate working draft will |
171 |
|
|
describle how resource descriptions can be used for this purpose. |
172 |
|
|
|
173 |
|
|
This specification builds upon the definition of the LINK element in |
174 |
|
|
HTML 2.0 in the following respects: |
175 |
|
|
|
176 |
|
|
<!ELEMENT LINK - O EMPTY> |
177 |
|
|
<!ATTLIST LINK |
178 |
|
|
|
179 |
|
|
Bos, Raggett & Lie Page 3 |
180 |
|
|
|
181 |
|
|
|
182 |
|
|
|
183 |
|
|
HTML and Style Sheets 22 Nov 1995 |
184 |
|
|
|
185 |
|
|
href CDATA #REQUIRED -- Universal Resource Locator -- |
186 |
|
|
title CDATA #IMPLIED -- advisory title string -- |
187 |
|
|
rel CDATA #IMPLIED -- forward link type -- |
188 |
|
|
rev CDATA #IMPLIED -- reverse link type -- |
189 |
|
|
media CDATA #IMPLIED -- Internet media type -- |
190 |
|
|
> |
191 |
|
|
|
192 |
|
|
* The forward link type "stylesheet" is hereby defined to signify |
193 |
|
|
that the associated LINK element specifies a link to a style |
194 |
|
|
sheet that may be applied to the HTML document containing the |
195 |
|
|
LINK element. The HREF attribute specifies the network address |
196 |
|
|
of the linked style sheet. |
197 |
|
|
|
198 |
|
|
|
199 |
|
|
|
200 |
|
|
* If there are several such links, then these are considered as |
201 |
|
|
providing a choice of alternative style sheets. The character |
202 |
|
|
string supplied with the TITLE attribute is recommended for use |
203 |
|
|
in building a menu of alternative styles. |
204 |
|
|
|
205 |
|
|
Note that the order of such LINK elements in the document markup |
206 |
|
|
does not signify preference order! |
207 |
|
|
|
208 |
|
|
|
209 |
|
|
|
210 |
|
|
* The MEDIA attribute may be used to specify the Internet Media |
211 |
|
|
type and associated parameters for the linked style sheet. This |
212 |
|
|
allows the user agent to disregard style sheets in unsupported |
213 |
|
|
notations, without the need to first make a remote query across |
214 |
|
|
the network. |
215 |
|
|
|
216 |
|
|
------------------------------------------------------------------------------ |
217 |
|
|
The STYLE element |
218 |
|
|
|
219 |
|
|
A single STYLE element may be included in the document head. It |
220 |
|
|
allows authors to include style rules within the HTML document, e.g. |
221 |
|
|
|
222 |
|
|
<HEAD> |
223 |
|
|
<TITLE>Title</TITLE> |
224 |
|
|
<STYLE NOTATION="application/css" SRC="weird.css"> |
225 |
|
|
H1 { color: brown } |
226 |
|
|
P { color: blue } |
227 |
|
|
</STYLE> |
228 |
|
|
</HEAD> |
229 |
|
|
|
230 |
|
|
In the example, the CSS notation is used. The STYLE element |
231 |
|
|
specifies color overrides to the "weird.css" style sheet for H1 and |
232 |
|
|
P elements. The STYLE element is formally defined by: |
233 |
|
|
|
234 |
|
|
<!ELEMENT style - O (#PCDATA)> |
235 |
|
|
<!ATTLIST style |
236 |
|
|
notation CDATA #REQUIRED -- Internet media type for style -- |
237 |
|
|
src CDATA #IMPLIED -- URL for separate style sheet -- |
238 |
|
|
|
239 |
|
|
Bos, Raggett & Lie Page 4 |
240 |
|
|
|
241 |
|
|
|
242 |
|
|
|
243 |
|
|
HTML and Style Sheets 22 Nov 1995 |
244 |
|
|
|
245 |
|
|
title CDATA #IMPLIED -- advisory title for this style -- |
246 |
|
|
> |
247 |
|
|
|
248 |
|
|
The attributes are defined as follows: |
249 |
|
|
|
250 |
|
|
NOTATION |
251 |
|
|
This required attribute defines the style notation as an |
252 |
|
|
Internet Media type including associated parameters. It is used |
253 |
|
|
in exactly the same way as with LINK elements. The notation |
254 |
|
|
applies to an external style sheet linked via the SRC attribute |
255 |
|
|
and to rendering annotations on elements in the document body |
256 |
|
|
attached with the STYLE attribute. |
257 |
|
|
|
258 |
|
|
|
259 |
|
|
|
260 |
|
|
SRC |
261 |
|
|
This may be used to specify the URL for a base style sheet. The |
262 |
|
|
style sheet must use the same notation as rendering instructions |
263 |
|
|
in the STYLE element, and will normally be overridden by those |
264 |
|
|
instructions or subsequent STYLE attributes in the document |
265 |
|
|
body. |
266 |
|
|
|
267 |
|
|
This attribute is needed for the extremely common case where a |
268 |
|
|
linked style sheet is overridden by a few rules in the style |
269 |
|
|
element or by properties given by the style attribute on |
270 |
|
|
particular elements. In the absence of the SRC attribute you |
271 |
|
|
would need to include the style element, a link element and a |
272 |
|
|
means for selecting which link element to use. |
273 |
|
|
|
274 |
|
|
|
275 |
|
|
|
276 |
|
|
TITLE |
277 |
|
|
The user agent is recommended to use the title string when |
278 |
|
|
building a menu of alternative style sheets. This will only |
279 |
|
|
happen if the STYLE element occurs together with linked style |
280 |
|
|
sheets as specified by one or more LINK elements. In the absence |
281 |
|
|
of such LINK elements, the TITLE attribute may be used to |
282 |
|
|
describe the style sheet for the purpose of allowing the user to |
283 |
|
|
turn style sheets on and off. |
284 |
|
|
|
285 |
|
|
|
286 |
|
|
|
287 |
|
|
CSS supports the ability to cascade several style sheets so that |
288 |
|
|
their effects are blended together. The STYLE element can be used |
289 |
|
|
with CSS to cascade style sheets using the CSS @import command, e.g. |
290 |
|
|
|
291 |
|
|
<HEAD> |
292 |
|
|
<TITLE>Title</TITLE> |
293 |
|
|
<STYLE NOTATION="application/css"> |
294 |
|
|
@import "house-style.css" |
295 |
|
|
@import "draft-report.css" |
296 |
|
|
H1 { color: red } -- override cascaded style sheets -- |
297 |
|
|
</STYLE> |
298 |
|
|
|
299 |
|
|
Bos, Raggett & Lie Page 5 |
300 |
|
|
|
301 |
|
|
|
302 |
|
|
|
303 |
|
|
HTML and Style Sheets 22 Nov 1995 |
304 |
|
|
|
305 |
|
|
</HEAD> |
306 |
|
|
|
307 |
|
|
When the STYLE element occurs together with one or more LINK |
308 |
|
|
elements that specify linked style sheets, the user agent should |
309 |
|
|
consider the STYLE element in preference to the LINK elements. |
310 |
|
|
|
311 |
|
|
The content model for the STYLE element precludes SGML tags, and the |
312 |
|
|
end tag of a STYLE element can usually be omitted, e.g. when the |
313 |
|
|
STYLE element is followed by another element. Instances of the |
314 |
|
|
characters "&", "<" or ">" within rendering instructions should be |
315 |
|
|
escaped using SGML entities, e.g. & < and > respectively. |
316 |
|
|
|
317 |
|
|
Note that if we later decide to allow multiple STYLE elements in the |
318 |
|
|
document head, e.g. to cater for alternative styles, then we will |
319 |
|
|
need a different way of specifying the style notation in use for |
320 |
|
|
STYLE attributes for elements in the document body. The suggested |
321 |
|
|
choice is an attribute on the BODY element, e.g. "stylenotation", |
322 |
|
|
with the same definition as the "notation" attribute for the STYLE |
323 |
|
|
element. |
324 |
|
|
|
325 |
|
|
------------------------------------------------------------------------------ |
326 |
|
|
|
327 |
|
|
|
328 |
|
|
|
329 |
|
|
|
330 |
|
|
|
331 |
|
|
|
332 |
|
|
|
333 |
|
|
|
334 |
|
|
|
335 |
|
|
|
336 |
|
|
|
337 |
|
|
|
338 |
|
|
|
339 |
|
|
|
340 |
|
|
|
341 |
|
|
|
342 |
|
|
|
343 |
|
|
|
344 |
|
|
|
345 |
|
|
|
346 |
|
|
|
347 |
|
|
|
348 |
|
|
|
349 |
|
|
|
350 |
|
|
|
351 |
|
|
|
352 |
|
|
|
353 |
|
|
|
354 |
|
|
|
355 |
|
|
|
356 |
|
|
|
357 |
|
|
|
358 |
|
|
|
359 |
|
|
Bos, Raggett & Lie Page 6 |
360 |
|
|
|
361 |
|
|
|
362 |
|
|
|
363 |
|
|
HTML and Style Sheets 22 Nov 1995 |
364 |
|
|
|
365 |
|
|
Common Attributes |
366 |
|
|
|
367 |
|
|
To support effective use of style sheets with HTML documents a |
368 |
|
|
number of common attributes are proposed. These can be used with |
369 |
|
|
most HTML elements. In general, all attribute names and values in |
370 |
|
|
this specification are case insensitive, except where noted |
371 |
|
|
otherwise. |
372 |
|
|
|
373 |
|
|
|
374 |
|
|
<!ENTITY % attrs |
375 |
|
|
"id ID #IMPLIED -- element identifier -- |
376 |
|
|
class NAMES #IMPLIED -- for subclassing elements -- |
377 |
|
|
style CDATA #IMPLIED -- rendering annotation -- |
378 |
|
|
lang NAME #IMPLIED -- as per RFC 1766 -- |
379 |
|
|
dir (ltr|rtl) #IMPLIED -- I18N text direction --"> |
380 |
|
|
|
381 |
|
|
|
382 |
|
|
ID |
383 |
|
|
Used to define a document-wide identifier. This can be used for |
384 |
|
|
naming positions within documents as the destination of a |
385 |
|
|
hypertext link. It may also be used by style sheets for |
386 |
|
|
rendering an element in a unique style. An ID attribute value is |
387 |
|
|
an SGML NAME token. NAME tokens are formed by an initial letter |
388 |
|
|
followed by letters, digits, "-" and "." characters. The letters |
389 |
|
|
are restricted to A-Z and a-z. |
390 |
|
|
|
391 |
|
|
CLASS |
392 |
|
|
A space separated list of SGML NAME tokens. CLASS names specify |
393 |
|
|
that the element belongs to the corresponding named classes. |
394 |
|
|
These may be used by style sheets to provide class dependent |
395 |
|
|
renderings. |
396 |
|
|
|
397 |
|
|
STYLE |
398 |
|
|
A text string providing rendering information specific to this |
399 |
|
|
element. The notation is specified with the STYLE element in the |
400 |
|
|
document head. The default notation is hereby defined to be |
401 |
|
|
"application/css". |
402 |
|
|
|
403 |
|
|
For example: |
404 |
|
|
|
405 |
|
|
<TITLE>Test Document</TITLE> |
406 |
|
|
<STYLE NOTATION="application/css"> |
407 |
|
|
<P STYLE="color: red; font-style: small-caps">This text should |
408 |
|
|
be in small capitals and colored red! |
409 |
|
|
|
410 |
|
|
The end tag for the STYLE element has been omitted here since |
411 |
|
|
the element is unambigously ended by the <P> start tag. |
412 |
|
|
|
413 |
|
|
|
414 |
|
|
|
415 |
|
|
LANG |
416 |
|
|
A LANG attribute identifies the natural language used by the |
417 |
|
|
content of the associated element.The syntax and registry of |
418 |
|
|
|
419 |
|
|
Bos, Raggett & Lie Page 7 |
420 |
|
|
|
421 |
|
|
|
422 |
|
|
|
423 |
|
|
HTML and Style Sheets 22 Nov 1995 |
424 |
|
|
|
425 |
|
|
language values are defined by RFC 1766. In summary the language |
426 |
|
|
is given as a primary tag followed by zero or more subtags, |
427 |
|
|
separated by "-". White space is not allowed and all tags are |
428 |
|
|
case insensitive. The name space of tags is administered by |
429 |
|
|
IANA. The two letter primary tag is an ISO 639 language |
430 |
|
|
abbreviation, while the initial subtag is a two letter ISO 3166 |
431 |
|
|
country code. Example values for LANG include: |
432 |
|
|
|
433 |
|
|
en, en-US, en-uk, i-cherokee, x-pig-latin. |
434 |
|
|
|
435 |
|
|
DIR |
436 |
|
|
Human writing systems are grouped into scripts, which determine |
437 |
|
|
amongst other things, the direction the characters are written. |
438 |
|
|
Elements of the Latin script are nominally left to right, while |
439 |
|
|
those of the Arabic script are nominally right to left. These |
440 |
|
|
characters have what is called strong directionality. Other |
441 |
|
|
characters can be directionally neutral (spaces) or weak |
442 |
|
|
(punctuation). |
443 |
|
|
|
444 |
|
|
The DIR attribute specifies an encapsulation boundary which |
445 |
|
|
governs the interpretation of neutral and weakly directional |
446 |
|
|
characters. It does not override the directionality of strongly |
447 |
|
|
directional characters. The DIR attribute value is one of LTR |
448 |
|
|
for left to right, or RTL for right to left, e.g. DIR=RTL. |
449 |
|
|
|
450 |
|
|
------------------------------------------------------------------------------ |
451 |
|
|
The C Tag |
452 |
|
|
|
453 |
|
|
<!ELEMENT c O O (%text)*> |
454 |
|
|
<ATTLIST c |
455 |
|
|
%attrs; -- id, class, style, lang and dir -- |
456 |
|
|
> |
457 |
|
|
|
458 |
|
|
Sometimes it is desirable to apply a style to some text which |
459 |
|
|
doesn't have a structural role. For instance, the first few letters |
460 |
|
|
or words after a drop down capital may be rendered as small capital |
461 |
|
|
letters. In such situations it is inappropriate to use an existing |
462 |
|
|
tag such as <EM>. On existing user agents, the first letter would |
463 |
|
|
appear normally, but the next few would be mysteriously italicized. |
464 |
|
|
The new <C> tag is recommended instead, as it has no effect on |
465 |
|
|
existing user agents. |
466 |
|
|
|
467 |
|
|
An example based on CSS: |
468 |
|
|
|
469 |
|
|
<TITLE>Title</TITLE> |
470 |
|
|
<STYLE NOTATION="application/css"> |
471 |
|
|
P { |
472 |
|
|
text-effect: drop-cap, |
473 |
|
|
font-size: 12pt, |
474 |
|
|
alt-font-size: 24pt -- assuming leading is zero -- |
475 |
|
|
} |
476 |
|
|
C { font-style: small-caps } |
477 |
|
|
</STYLE> |
478 |
|
|
|
479 |
|
|
Bos, Raggett & Lie Page 8 |
480 |
|
|
|
481 |
|
|
|
482 |
|
|
|
483 |
|
|
HTML and Style Sheets 22 Nov 1995 |
484 |
|
|
|
485 |
|
|
<P>T<C>he first</C> few words of an article in The Economist.. |
486 |
|
|
|
487 |
|
|
This would be formatted to look something like: |
488 |
|
|
|
489 |
|
|
___ |
490 |
|
|
| HE FIRST few words |
491 |
|
|
| of an article in the |
492 |
|
|
Economist.. |
493 |
|
|
|
494 |
|
|
While on an existing user agent it would look like: |
495 |
|
|
|
496 |
|
|
The first few words of an |
497 |
|
|
article in the Economist.. |
498 |
|
|
|
499 |
|
|
------------------------------------------------------------------------------ |
500 |
|
|
User interface and user supplied style sheets |
501 |
|
|
|
502 |
|
|
In an interactive user agent, if an external (i.e., not built into |
503 |
|
|
the user agent or supplied by the user) style is being applied, the |
504 |
|
|
user should be made aware of it and be given the option of turning |
505 |
|
|
it off, or of selecting a different style, either for this document |
506 |
|
|
only or for all future documents as well. A flag in the corner of |
507 |
|
|
the window or an option button in the menubar should be enough. |
508 |
|
|
|
509 |
|
|
It may be possible for the user to combine several of the available |
510 |
|
|
style sheets. At least it should be possible for the user to choose |
511 |
|
|
a personal style instead of, or maybe in combination with, external |
512 |
|
|
style sheets. |
513 |
|
|
|
514 |
|
|
When a user agent applies a style sheet to a document while the |
515 |
|
|
author of that document has indicated a preference for a different |
516 |
|
|
style sheet, the user agent may have to alert the user to that fact. |
517 |
|
|
Exactly how and when that is done is outside the scope of this |
518 |
|
|
report. E.g., the CSS style sheet language gives precise rules for |
519 |
|
|
the conditions under which a user is allowed to override the |
520 |
|
|
author's choices. |
521 |
|
|
|
522 |
|
|
------------------------------------------------------------------------------ |
523 |
|
|
Deployment Issues |
524 |
|
|
|
525 |
|
|
The introduction of style sheets will give authors and users much |
526 |
|
|
greater control over the appearence of documents. It will also |
527 |
|
|
remove the pressure on vendors to extend HTML itself when ever a new |
528 |
|
|
rendering feature is needed. However, it will take time for |
529 |
|
|
widespread deployment of support for style sheets. What are some of |
530 |
|
|
the deployment issues? |
531 |
|
|
|
532 |
|
|
Traditionally, HTML user agents have silently ignored unknown start |
533 |
|
|
and end tags, or unknown attributes. Very few user agents support |
534 |
|
|
the LINK element. As as result: |
535 |
|
|
|
536 |
|
|
* The use of LINK for style sheets will be ignored |
537 |
|
|
|
538 |
|
|
|
539 |
|
|
Bos, Raggett & Lie Page 9 |
540 |
|
|
|
541 |
|
|
|
542 |
|
|
|
543 |
|
|
HTML and Style Sheets 22 Nov 1995 |
544 |
|
|
|
545 |
|
|
* The STYLE attribute will be ignored |
546 |
|
|
|
547 |
|
|
* The STYLE element will be ignored, but its contents will be |
548 |
|
|
treated as part of the document body, and rendered as such. |
549 |
|
|
|
550 |
|
|
As a result it is recommended that during the transition phase, |
551 |
|
|
authors avoid placing rendering instructions within the STYLE |
552 |
|
|
element. This leaves authors free to place rendering instructions |
553 |
|
|
within STYLE attributes on specific HTML elements and to use |
554 |
|
|
separate style sheets, linked via the STYLE element or one or more |
555 |
|
|
LINK elements. |
556 |
|
|
|
557 |
|
|
This restriction may be lifted if vendors adopt another proposal by |
558 |
|
|
the World Wide Web Consortium for specifying variants of network |
559 |
|
|
resources. The resource variants mechanism would allow authors to |
560 |
|
|
serve up two versions of a document, one designed for old user |
561 |
|
|
agents and one for new user agents. The choice is made by the user |
562 |
|
|
agent based on descriptions of resource variants. The resource |
563 |
|
|
variants mechanism is the subject of a related working draft. |
564 |
|
|
|
565 |
|
|
|
566 |
|
|
|
567 |
|
|
------------------------------------------------------------------------------ |
568 |
|
|
Performance Issues |
569 |
|
|
|
570 |
|
|
Some people have voiced concerns over performance issues for style |
571 |
|
|
sheets. For instance, if the user agent has to wait until it has |
572 |
|
|
finished down loading lengthy style sheets, before it can start to |
573 |
|
|
display a document, then users will start to complain. A similar |
574 |
|
|
situation arises if the document head includes a lengthy set of |
575 |
|
|
style rules. |
576 |
|
|
|
577 |
|
|
The current proposal sidesteps these issues, by allowing authors to |
578 |
|
|
include rendering instructions within each HTML element. The |
579 |
|
|
rendering information is then always available by the time the user |
580 |
|
|
agent wants to render each element. |
581 |
|
|
|
582 |
|
|
In many cases, authors will take advantage of a common style sheet |
583 |
|
|
for a group of documents. In this case, distributing rendering |
584 |
|
|
information through out the document will actually lead to worse |
585 |
|
|
performance than using a linked style sheet, since for most |
586 |
|
|
documents, the style sheet will already be present in the local |
587 |
|
|
cache. The public availability of good style sheets will encourage |
588 |
|
|
this effect. |
589 |
|
|
|
590 |
|
|
The ability to override style sheets with information in the |
591 |
|
|
document head, or on individual HTML elements, increases the |
592 |
|
|
effectiveness of the local cache. Small changes to the document |
593 |
|
|
style can be kept out of the common style sheet, thereby allowing |
594 |
|
|
the same style sheet to be used with more documents, which in turn |
595 |
|
|
increases the chances of finding it in the cache. |
596 |
|
|
|
597 |
|
|
------------------------------------------------------------------------------ |
598 |
|
|
|
599 |
|
|
Bos, Raggett & Lie Page 10 |
600 |
|
|
|
601 |
|
|
|
602 |
|
|
|
603 |
|
|
HTML and Style Sheets 22 Nov 1995 |
604 |
|
|
|
605 |
|
|
References |
606 |
|
|
|
607 |
|
|
RFC 1866 |
608 |
|
|
"Hypertext Markup Language - 2.0" by T. Berners-Lee & D. |
609 |
|
|
Connolly, November 1995. This document can be downloaded from |
610 |
|
|
ftp://ds.internic.net/rfc/rfc1866.txt. |
611 |
|
|
|
612 |
|
|
RFC 1766 |
613 |
|
|
"Tags for the Identification of Languages", by H. Alvestrand, |
614 |
|
|
UNINETT, March 1995. This document can be downloaded from |
615 |
|
|
ftp://ds.internic.net/rfc/rfc1766.txt. |
616 |
|
|
|
617 |
|
|
CSS (5th draft) |
618 |
|
|
"Cascading style sheets" by Hekon Lie & Bert Bos, November 1995. |
619 |
|
|
This document can be downloaded from |
620 |
|
|
http://www.w3.org/hypertext/WWW/Style/css/draft5.html |
621 |
|
|
|
622 |
|
|
------------------------------------------------------------------------------ |
623 |
|
|
The World Wide Web Consortium: http://www.w3.org/ |
624 |
|
|
|
625 |
|
|
|
626 |
|
|
|
627 |
|
|
|
628 |
|
|
|
629 |
|
|
|
630 |
|
|
|
631 |
|
|
|
632 |
|
|
|
633 |
|
|
|
634 |
|
|
|
635 |
|
|
|
636 |
|
|
|
637 |
|
|
|
638 |
|
|
|
639 |
|
|
|
640 |
|
|
|
641 |
|
|
|
642 |
|
|
|
643 |
|
|
|
644 |
|
|
|
645 |
|
|
|
646 |
|
|
|
647 |
|
|
|
648 |
|
|
|
649 |
|
|
|
650 |
|
|
|
651 |
|
|
|
652 |
|
|
|
653 |
|
|
|
654 |
|
|
|
655 |
|
|
|
656 |
|
|
|
657 |
|
|
|
658 |
|
|
|
659 |
|
|
Bos, Raggett & Lie Page 11 |
660 |
|
|
|