css-style-attr/Overview.src.html

Tue, 19 Jan 2010 18:02:25 +0000

author
Elika Etemad <fantasai.cvs@inkedblade.net>
date
Tue, 19 Jan 2010 18:02:25 +0000
changeset 1621
15de3a6645bc
parent 1620
3a18ef00b9b9
child 1624
1fa22f8caa3d
permissions
-rwxr-xr-x

fix link to fantasai's contact info, add domain for w3.org spec link

     1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
     2 <html lang="en">
     3 <head>
     4   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     5   <title>CSS Styling Attributes Level 1</title>
     6   <link rel="stylesheet" type="text/css" href="default.css">
     8   <link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-ED">
     9 </head>
    11 <div class="head">
    12 <!--logo-->
    14 <h1>CSS Styling Attributes Level 1</h1>
    16 <h2 class="no-num no-toc">[LONGSTATUS] [DATE]</h2>
    17 <dl>
    18   <dt>This version:</dt>
    19     <dd><dd><a href="http://www.w3.org/TR/[YEAR]/WD-css-style-attr-[CDATE]/">http://www.w3.org/TR/[YEAR]/WD-css-style-attr-[CDATE]/</a></dd>
    20     <!-- <dd><a href="http://dev.w3.org/csswg/css-style-attr/">http://dev.w3.org/csswg/css-style-attr/</a> -->
    21   <dt>Latest version:
    22     <dd><a href="http://www.w3.org/TR/css-style-attr">http://www.w3.org/TR/css-style-attr</a>
    23   <dt>Previous version:
    24     <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>
    25   <dt>Editor:
    26     <dd><a href="http://fantasai.inkedblade.net/contact">Elika J. Etemad</a>
    27   <dt>Previous Editors:
    28   <dd><span lang="tr">Tantek &Ccedil;elik</span> (<a href="http://www.microsoft.com/">Microsoft</a>), &lt;<a href="mailto:tantekc@microsoft.com">tantekc@microsoft.com</a>&gt;
    29   <dd><a href="http://www.w3.org/People/Bos/">Bert Bos</a> (<a href="http://www.w3.org/">W3C</a>), &lt;<a href="mailto:bert@w3.org">bert@w3.org</a>&gt;
    30   <dd>Marc Attinasi (AOL/Netscape), &lt;<a href="mailto:attinasi@netscape.com">attinasi@netscape.com</a>&gt;
    31 </dl>
    32 <!--begin-copyright-->
    33 <p>[Here will be included the file "../copyright.inc"]</p>
    34 <!--end-copyright-->
    36 <hr title="Separator for header">
    37 </div>
    39 <h2 class="no-num no-toc" id="abstract">Abstract</h2>
    41 <p>Markup languages such as HTML and SVG provide a styling attribute on most
    42 elements, to hold a fragment of a style sheet that applies to those elements.
    43 One of the possible style sheet languages is CSS. This draft describes the
    44 syntax of the CSS fragment that can be used in the styling attribute.
    46 <h2 class="no-num no-toc" id="status">Status of this document</h2>
    47 <!--status-->
    48   <p>This specification is a <strong>Last Call Working Draft</strong>. All
    49    persons are encouraged to review this document and <strong>send comments
    50    to the <a
    51    href="http://lists.w3.org/Archives/Public/www-style/">www-style</a>
    52    mailing list</strong> as described above. The <strong>deadline for
    53    comments</strong> is <strong>9 February 2010</strong>.
    55   <p>A CSS Styling Attribute <a href="http://www.w3.org/Style/CSS/Test/">Test
    56    Suite</a> will be developed during the Candidate Recommendation phase of
    57    this CSS Styling Attribute specification.
    59 <h2 class="no-num no-toc" id="contents">Table of contents</h2>
    60 <!--toc-->
    62 <h2 id="intro">Introduction</h2>
    64 <p>Some document formats have a <dfn>styling attribute</dfn> to permit
    65 the author to directly apply style information to specific elements
    66 in documents. If a document format defines a styling attribute and the
    67 attribute accepts CSS as its value, then this specification defines this
    68 <dfn>CSS styling attribute</dfn>&rsquo;s syntax and interpretation.
    70 <div class="example">
    71   <p>The following example shows the use of the <code>style</code> attribute
    72   in HTML:</p>
    73   <pre>&lt;p style="<em>color: #090; line-height: 1.2</em>"&gt;...&lt;/p&gt;</pre>
    74 </div>
    76 <h2 id="conformance">Conformance</h2>
    78 <p>A document or implementation cannot conform to CSS Styling Attributes
    79 Level 1 alone, but can claim conformance to CSS Styling Attributes Level 1
    80 if it satisfies the conformance requirements in this specification when
    81 implementing CSS together with styling attribute handling as defined in a
    82 document language that has CSS styling attributes.</p>
    84 <p>Conformance to CSS Styling Attributes Level 1 is defined for two
    85 classes:
    86 <dl>
    87   <dt><dfn>document</dfn></dt>
    88     <dd>A document represented in a document language that defines a styling
    89       attribute for one or more of its elements.
    90   <dt><dfn>interpreter</dfn></dt>
    91     <dd>Someone or something that interprets the semantics of a document and
    92       its associated style information.
    93       (Most CSS <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">user
    94       agents</a> fall under this category.)</dd>
    95 </dl>
    97 <p>The conformance requirements are expressed with a combination of
    98   descriptive assertions and RFC 2119 terminology. The key words "MUST",
    99   "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
   100   "RECOMMENDED", "MAY", and "OPTIONAL" in the normative parts of this
   101   document are to be interpreted as described in RFC 2119.
   102   However, for readability, these words do not appear in all uppercase
   103   letters in this specification. All of the text of this specification is
   104   normative except sections explicitly marked as non-normative, examples,
   105   and notes. [[!RFC2119]]</p>
   107 <p>Examples in this specification are introduced with the words "for example"
   108   or are set apart from the normative text with <code>class="example"</code>,
   109   like this:
   111 <div class="example">
   112   <p>This is an example of an informative example.</p>
   113 </div>
   115 <p>Informative notes begin with the word "Note" and are set apart from the
   116   normative text with <code>class="note"</code>, like this:
   118 <p class="note">Note, this is an informative note.</p>
   120 <h2 id="syntax">Syntax and Parsing</h2>
   122 <p>The value of the styling attribute must match the syntax of the contents of
   123 a CSS <a href="http://www.w3.org/TR/CSS21/syndata.html#rule-sets">declaration
   124 block</a>, whose formal grammar is given below in terms of the
   125 <a href="http://www.w3.org/TR/CSS21/syndata.html#syntax">CSS core grammar</a>:
   127 <pre>
   128 declaration-list
   129   : S* declaration? [ ';' S* declaration? ]*
   130   ;
   131 </pre>
   133 <p class="note">Note that following the CSS2.1 convention, comment tokens
   134 are not shown in the rule above.
   136 <p>The interpreter must parse the styling attribute's value using the
   137 same forward-compatible parsing rules that apply to parsing declaration block
   138 contents in a normal CSS style sheet. See
   139 <a href="http://www.w3.org/TR/CSS21/syndata.html">chapter 4 of the CSS2.1
   140 specification</a> for details. [[!CSS21]]
   142 <p class="note">Note that because there is no open brace delimiting the
   143 declaration list in the CSS styling attribute syntax, a close brace
   144 (<code>}</code>) in the styling attribute's value does not terminate the
   145 style data: it is merely an invalid token.</p>
   147 <h2 id="interpret">Cascading and Interpretation</h2>
   149 <p>The declarations in a styling attribute apply to the element to which
   150 the attribute belongs. CSS2.1 <a href="http://www.w3.org/TR/CSS21/cascade.html#specificity">defines</a>
   151 how style sheets and styling attributes are cascaded together. [[!CSS21]]
   152 Relative URLs in the style data must be resolved relative to the styling
   153 attribute's element (or to the document if per-element resolution is not
   154 defined) when the attribute's value is parsed<!-- so dynamic changes to
   155 the base URL don't affect the CSS ~Hixie -->.
   157 <p>Aside from the differences in cascading, the declarations in a styling
   158 attribute must be interpreted exactly as if they were given in a CSS
   159 style rule that applies to the element.
   161 <p>The CSS Working Group strongly recommends that document languages do
   162 not allow multiple CSS styling attributes on a single element. If a document
   163 language allows multiple CSS styling attributes, each must be parsed
   164 independently and treated as a separate style rule, the ordering of which
   165 should be defined by the document language, else is undefined.
   167 <h2 id="ack">Acknowledgments</h2>
   169 <p>Thanks to feedback from Daniel Glazman, Ian Hickson, Eric A. Meyer,
   170 Bj&ouml;rn H&ouml;hrmann.
   172 <h2 id="references">References
   174 <h3 class="no-num" id="normative-references">Normative references</h3>
   176 <!--begin-normative-->
   177 <p>[Here will be inserted the file "normative.inc"]</p>
   178 <!--end-normative-->
   180 <h3 class="no-num" id="informative-references">Informative references</h3>
   182 <!--begin-informative-->
   183 <p>[Here will be inserted the file "informative.inc"]</p>
   184 <!--end-informative-->
   186 </body>
   187 </html>
   188 <!-- Keep this comment at the end of the file
   189 Local variables:
   190 mode: sgml
   191 sgml-declaration:"~/SGML/HTML4.decl"
   192 sgml-default-doctype-name:"html"
   193 sgml-minimize-attributes:t
   194 sgml-nofill-elements:("pre" "style" "br")
   195 End:
   196 -->

mercurial