Skip to content

Commit 246f598

Browse files
committed
[css2] Minor fixes and work on attr() function
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%401209
1 parent e824e4d commit 246f598

1 file changed

Lines changed: 27 additions & 25 deletions

File tree

css2/generate.src

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class="propinst-content">'content'</span> property.
4848
<h2><a name="before-after-content">The</a> <span class="index-def"
4949
title=":before|pseudo-elements:::before|before">:before</span> and <span
5050
class="index-def" title=":after|pseudo-elements:::after|after">:after</span>
51-
pseudo elements</h2>
51+
pseudo-elements</h2>
5252

5353
<p>Authors specify the style and location of generated content with
5454
the :before and :after pseudo-elements. The <span
@@ -62,6 +62,9 @@ from the element to which they are attached.</p>
6262
specify content, and the style of that content, before and after an
6363
element's <a href="conform.html#doctree">document tree</a> content.
6464

65+
<!-- Do they allow the position and float properties? Probably
66+
not. Must say so. -IJ -->
67+
6568
<P>The :before and :after pseudo-elements elements allow
6669
values of the <span class="propinst-display">'display'</span>
6770
property as follows:
@@ -176,37 +179,40 @@ counter at this point in the rendering structure, in the indicated
176179
style ('decimal' by default).
177180

178181
<dt><span class="index-inst" title="open-quote"><span
179-
class="value-inst-open-quote"><strong>'open-quote'</strong></span></span> and
182+
class="value-inst-open-quote"><strong>open-quote</strong></span></span> and
180183
<span class="index-inst" title="close-quote"><span
181184
class="value-inst-close-quote">'close-quote'</span></span>
182185

183186
<dd>Both of these values are replaced by the appropriate string
184187
from the <span class="propinst-quotes"><strong>'quotes'</strong></span> property.
185188

186189
<dt><span class="index-inst" title="no-open-quote"><span
187-
class="value-inst-no-open-quote"><strong>'no-open-quote'</strong></span></span>
190+
class="value-inst-no-open-quote"><strong>no-open-quote</strong></span></span>
188191

189192
<dd>Inserts nothing (the empty string), but increments the level of
190193
nesting for quotes.
191194

192195
<dt><span class="index-inst" title="no-close-quote"><span
193-
class="value-inst-no-close-quote"><strong>'no-close-quote'</strong></span></span>
196+
class="value-inst-no-close-quote"><strong>no-close-quote</strong></span></span>
194197

195198
<dd>Inserts nothing (the empty string), but decrements the level of
196199
nesting for quotes.
197-
</dl>
198200

199-
<p>It is also possible to insert the value of an <span
200-
class="index-inst" title="attr()">attribute</span>, by using the
201-
<!--<a href="syndata.html#attr">-->
202-
'attr()'
203-
<!--</a>-->
204-
function.
205-
<!--<p>Attributes in the source document can also be used wherever
206-
strings are expected.-->
207-
The function <span class="index-def" title="attr()">'attr(X)'</span>
208-
returns the value of attribute X. If the current element doesn't have
209-
an attribute X, an empty string is returned.
201+
<dt><span class="index-def" title="attr()">attr(X)</span>
202+
<dd>It is also possible to insert the value of an
203+
attribute by using the
204+
'attr()' function, which returns the value of attribute X. If
205+
the current element doesn't have an attribute X, an empty string is
206+
returned.
207+
208+
<P>If two or more attributes named 'X' appear in a selector,
209+
the value of the rightmost attribute is the one inserted
210+
by 'attr(X)'.
211+
212+
<p>The case-sensitivity of attribute names depends on the
213+
document language.
214+
215+
<p class="note">[Should the name of the attribute be quoted? BB]
210216

211217
<!--
212218
<p>Note that the string is parsed according to the rules of the
@@ -215,23 +221,19 @@ document language, not CSS, which means that numerical escapes like
215221
space and an "A", resp.), but that backslashes are not special ("\20"
216222
is <em>not</em> replaced by a space).
217223
-->
224+
</dl>
225+
218226

219227
<div class="example">
220-
<p>This rule inserts the text of the ALT attribute before the
228+
<p>This rule inserts the text of the HTML "alt" attribute before the
221229
image. If the image is not displayed, the reader will still see the
222-
ALT text.
230+
"alt" text.
223231

224232
<pre>
225-
IMG:before {content: attr(ALT)}
233+
IMG:before {content: attr(alt)}
226234
</pre>
227235
</div>
228236

229-
<p class="note">[Should the name of the attribute be quoted? BB]
230-
231-
<!-- About extending this to other types than strings:
232-
Note: URL is subtle. Must return the BASE of the
233-
source document and return a location-independent URL -->
234-
235237
<div class=note>
236238
<p><em><strong>Note.</strong> In future levels of CSS, the <span
237239
class="propinst-content">'content'</span> property may accept

0 commit comments

Comments
 (0)