forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverview.html
More file actions
319 lines (244 loc) · 12.1 KB
/
Overview.html
File metadata and controls
319 lines (244 loc) · 12.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang=en>
<head><meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<title>CSS Style Attribute Syntax Level 1</title>
<link href="../default.css" rel=stylesheet type="text/css">
<link href="http://www.w3.org/StyleSheets/TR/W3C-ED" rel=stylesheet
type="text/css">
<body>
<div class=head> <!--begin-logo-->
<p><a href="http://www.w3.org/"><img alt=W3C height=48
src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
<h1>CSS Style Attribute Syntax Level 1</h1>
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 12 December
2009</h2>
<dl>
<dt>This version:</dt>
<!-- <dd><dd><a href="http://www.w3.org/TR/2009/WD-css-style-attr-20091212/">http://www.w3.org/TR/2009/WD-css-style-attr-20091212/</a></dd> -->
<dd><a
href="http://dev.w3.org/csswg/css-style-attr/">http://dev.w3.org/csswg/css-style-attr/</a>
<dt>Latest version:
<dd><a
href="http://www.w3.org/TR/css-style-attr">http://www.w3.org/TR/css-style-attr</a>
<dt>Previous version:
<dd><a
href="http://www.w3.org/TR/2002/WD-css-style-attr-20020515">http://www.w3.org/TR/2002/WD-css-style-attr-20020515</a>
<dt>Editor:
<dd><a href="http://fantasai.inkedblade.net/contact/">Elika J. Etemad</a>
<dt>Previous Editors:
<dd><span lang=tr>Tantek Çelik</span> (<a
href="http://www.microsoft.com/">Microsoft</a>), <<a
href="mailto:tantekc@microsoft.com">tantekc@microsoft.com</a>>
<dd><a href="http://www.w3.org/People/Bos/">Bert Bos</a> (<a
href="http://www.w3.org/">W3C</a>), <<a
href="mailto:bert@w3.org">bert@w3.org</a>>
<dd>Marc Attinasi (AOL/Netscape), <<a
href="mailto:attinasi@netscape.com">attinasi@netscape.com</a>>
</dl>
<!--begin-copyright-->
<p class=copyright><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=license>Copyright</a> © 2009 <a
href="http://www.w3.org/"><acronym title="World Wide Web
Consortium">W3C</acronym></a><sup>®</sup> (<a
href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute
of Technology">MIT</acronym></a>, <a
href="http://www.ercim.org/"><acronym title="European Research Consortium
for Informatics and Mathematics">ERCIM</acronym></a>, <a
href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a
href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
and <a
href="http://www.w3.org/Consortium/Legal/copyright-documents">document
use</a> rules apply.</p>
<!--end-copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id=abstract>Abstract</h2>
<p>Markup languages such as HTML and SVG provide a "style" attribute on
most elements, to hold a fragment of a style sheet that applies to those
elements. One of the possible style sheet languages is CSS. This draft
describes the syntax of the CSS fragment that can be used in the "style"
attribute.
<h2 class="no-num no-toc" id=status>Status of this document</h2>
<!--begin-status-->
<p>This is a public copy of the editors' draft. It is provided for
discussion only and may change at any moment. Its publication here does
not imply endorsement of its contents by W3C. Don't cite this document
other than as work in progress.
<p>The (<a
href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
mailing list <a
href="mailto:www-style@w3.org?Subject=%5Bcss-style-attr%5D%20PUT%20SUBJECT%20HERE">
www-style@w3.org</a> (see <a
href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
discussion of this specification. When sending e-mail, please put the text
“css-style-attr” in the subject, preferably like this:
“[<!---->css-style-attr<!---->] <em>…summary of
comment…</em>”
<p>This document was produced by the <a href="/Style/CSS/members">CSS
Working Group</a> (part of the <a href="/Style/">Style Activity</a>).
<p>This document was produced by a group operating under the <a
href="/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent
Policy</a>. W3C maintains a <a href="/2004/01/pp-impl/32061/status"
rel=disclosure>public list of any patent disclosures</a> made in
connection with the deliverables of the group; that page also includes
instructions for disclosing a patent. An individual who has actual
knowledge of a patent which the individual believes contains <a
href="/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with <a
href="/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the
W3C Patent Policy</a>.</p>
<!--end-status-->
<h2 class="no-num no-toc" id=contents>Table of contents</h2>
<!--begin-toc-->
<ul class=toc>
<li><a href="#intro"><span class=secno>1. </span>Introduction</a>
<li><a href="#syntax"><span class=secno>2. </span>Syntax</a>
<li><a href="#grammar"><span class=secno>3. </span>Grammar</a>
<li><a href="#interpret"><span class=secno>4. </span>Cascading and
Interpretation</a>
<li><a href="#conformance"><span class=secno>5. </span>Conformance</a>
<li><a href="#ack"><span class=secno>6. </span>Acknowledgments</a>
<li><a href="#references"><span class=secno>7. </span>References </a>
<ul class=toc>
<li class=no-num><a href="#normative-references">Normative
references</a>
<li class=no-num><a href="#informative-references">Informative
references</a>
</ul>
</ul>
<!--end-toc-->
<h2 id=intro><span class=secno>1. </span>Introduction</h2>
<p>Several XML-based document formats have a "style" attribute to permit
the author to directly apply style information to specific elements in
documents. If a document format defines a "style" attribute and the
attribute accepts CSS as its value, then this specification describes the
attribute's syntax and interpretation.
<div class=example>
<p>The following example shows the use of the <code>style</code> attribute
in HTML:</p>
<pre><p style="<em>color: #090; line-height: 1.2</em>">...</p></pre>
</div>
<h2 id=syntax><span class=secno>2. </span>Syntax</h2>
<p>The syntax of the style attribute syntax is exactly the same as the
contents of a CSS <a
href="http://www.w3.org/TR/CSS21/syndata.html#rule-sets">declaration
block</a>. A close brace (<code>}</code>) in the style attribute value
does not terminate the style data; it is merely an invalid token.
<p>The same rules for forward-compatible parsing apply to the inline style
sheet as to a normal style sheet. See <a
href="http://www.w3.org/TR/CSS21/syndata.html">chapter 4 of the CSS2.1
specification</a>. <a href="#CSS21"
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>
<h2 id=grammar><span class=secno>3. </span>Grammar</h2>
<p>The syntax of the CSS fragment that is allowed in the HTML "style"
attribute can be formally specified as follows:
<pre>
inline-stylesheet
: S* declaration-list
;
declaration-list
: declaration [ ';' S* declaration ]*
;
</pre>
<p>Please refer to the grammar in <a
href="http://www.w3.org/TR/CSS21/grammar.html">appendix D of the CSS2.1
specification</a> <a href="#CSS21"
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a> for the definition of the
symbols not defined here.
<h2 id=interpret><span class=secno>4. </span>Cascading and Interpretation</h2>
<p>The declarations in a style attribute apply to the element to which the
attribute belongs. CSS2.1 <a
href="/TR/CSS21/cascade.html#specificity">defines</a> how style sheets and
"style" attributes are cascaded together. <a href="#CSS21"
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a> Aside from the differences in
cascading, the declarations in a style attribute must be interpreted
exactly as if they were given in a CSS style rule applied to the element.
<p>The CSS Working Group strongly recommends that document languages do not
allow multiple style attributes on a single element. If a document
language allows multiple style attributes, each is parsed independently
and treated as a separate style rule, the ordering of which should be
defined by the document language, else is undefined.
<h2 id=conformance><span class=secno>5. </span>Conformance</h2>
<p>A document or implementation cannot conform to CSS Style Attribute
Syntax Level 1 alone, but can claim conformance to CSS Style Attribute
Syntax Level 1 if it satisfies the conformance requirements in this
specification when implementing CSS together with style attribute handling
as defined in a document language that has style attributes.
<p>Conformance to CSS Style Attribute Syntax Level 1 is defined for two
classes:
<dl>
<dt><dfn id=document>document</dfn>
<dd>A document represented in a document language that defines a style
attribute for one or more of its elements.
<dt><dfn id=interpreter>interpreter</dfn>
<dd>Someone or something that interprets the semantics of a document and
its associated style information. (Most CSS <a
href="http://www.w3.org/TR/CSS21/conform.html#user-agent">user agents</a>
fall under this category.)
</dl>
<p>The conformance requirements are expressed with a combination of
descriptive assertions and RFC 2119 terminology. The key words "MUST",
"MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
"RECOMMENDED", "MAY", and "OPTIONAL" in the normative parts of this
document are to be interpreted as described in RFC 2119. However, for
readability, these words do not appear in all uppercase letters in this
specification. All of the text of this specification is normative except
sections explicitly marked as non-normative, examples, and notes. <a
href="#RFC2119" rel=biblioentry>[RFC2119]<!--{{!RFC2119}}--></a>
<p>Examples in this specification are introduced with the words "for
example" or are set apart from the normative text with
<code>class="example"</code>, like this:
<div class=example>
<p>This is an example of an informative example.</p>
</div>
<p>Informative notes begin with the word "Note" and are set apart from the
normative text with <code>class="note"</code>, like this:
<p class=note>Note, this is an informative note.
<h2 id=ack><span class=secno>6. </span>Acknowledgments</h2>
<p>Thanks to feedback from Daniel Glazman, Ian Hickson, Eric A. Meyer,
Björn Höhrmann.
<h2 id=references><span class=secno>7. </span>References</h2>
<h3 class=no-num id=normative-references>Normative references</h3>
<!--begin-normative-->
<!-- Sorted by label -->
<dl class=bibliography>
<dt style="display: none"><!-- keeps the doc valid if the DL is empty -->
<!---->
<dt id=CSS21>[CSS21]
<dd>Bert Bos; et al. <a
href="http://www.w3.org/TR/2009/CR-CSS2-20090908"><cite>Cascading Style
Sheets Level 2 Revision 1 (CSS 2.1) Specification.</cite></a> 8 September
2009. W3C Candidate Recommendation. (Work in progress.) URL: <a
href="http://www.w3.org/TR/2009/CR-CSS2-20090908">http://www.w3.org/TR/2009/CR-CSS2-20090908</a>
</dd>
<!---->
<dt id=RFC2119>[RFC2119]
<dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key
words for use in RFCs to Indicate Requirement Levels.</cite></a> Internet
RFC 2119. URL: <a
href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
</dd>
<!---->
</dl>
<!--end-normative-->
<h3 class=no-num id=informative-references>Informative references</h3>
<!--begin-informative-->
<!-- Sorted by label -->
<dl class=bibliography>
<dt style="display: none"><!-- keeps the doc valid if the DL is empty -->
<!---->
</dl>
<!--end-informative-->
</html>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-declaration:"~/SGML/HTML4.decl"
sgml-default-doctype-name:"html"
sgml-minimize-attributes:t
sgml-nofill-elements:("pre" "style" "br")
End:
-->