Skip to content

Commit 92cb012

Browse files
committed
Add an example of the 'normal case' for element().
1 parent c44d956 commit 92cb012

3 files changed

Lines changed: 27 additions & 5 deletions

File tree

css3-images/Overview.html

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -759,9 +759,17 @@ <h3 id=element-reference><span class=secno>3.3. </span> Using Elements as
759759
visual effects).</p>
760760

761761
<div class=example>
762-
<p class=issue>Steal one of the MozHacks examples, once I get permission
763-
to do so.</p>
764-
</div>
762+
<p>As a somewhat silly example, a &lt;p> element can be reused as a
763+
background elsewhere in the document:</p>
764+
765+
<pre>
766+
&lt;style>
767+
#src { color: white; background: lime; width: 300px; height: 40px; }
768+
#dst { color: black; background: element(#src); padding: 20px; margin: 20px 0; }
769+
&lt;/style>
770+
&lt;p id='src'>I'm an ordinary element!&lt;/p>
771+
&lt;p id='dst'>I'm using the previous element as my background!&lt;/p></pre>
772+
<img alt="" src=element-function.png></div>
765773
</dl>
766774

767775
<p>Implementations may either re-use existing bitmap data generated for the
@@ -2163,7 +2171,7 @@ <h3 id=image-orientation><span class=secno>6.2. </span> Orienting an Image
21632171
rotational correction to perform. The &lsquo;<a
21642172
href="#image-orientation0"><code
21652173
class=property>image-orientation</code></a>&rsquo; property provides a way
2166-
to specify an "out-of-band" rotation to be applied to image source data to
2174+
to apply an &rdquo;out-of-band&ldquo; rotation to image source data to
21672175
correctly orient an image.
21682176

21692177
<p class=note>Note this facility is not intended to specify layout
@@ -2235,6 +2243,10 @@ <h3 id=image-orientation><span class=secno>6.2. </span> Orienting an Image
22352243
rounded to -90deg), then moduloing the value by 1 turn (360deg, 400grad,
22362244
etc.).
22372245

2246+
<p class=note>Note that in CSS, orientation data encoded in the image (e.g.
2247+
EXIF data) is ignored. <span class=issue>Is this an issue? What do
2248+
printers do?</span>
2249+
22382250
<div class=example>
22392251
<p>The following example rotates the image 90 degrees clockwise:</p>
22402252

css3-images/Overview.src.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,17 @@ <h3 id='element-reference'>
413413
<p>If the referenced element has a transform applied to it or an ancestor, the transform must be ignored when rendering the element as an image. If the referenced element is broken across pages, the element must be displayed as if the page content areas were joined flush in the pagination direction (elements broken across lines or columns just render with their bounding box, as normal, which may have unintended visual effects).</p>
414414

415415
<div class='example'>
416-
<p class='issue'>Steal one of the MozHacks examples, once I get permission to do so.</p>
416+
<p>As a somewhat silly example, a &lt;p> element can be reused as a background elsewhere in the document:</p>
417+
418+
<pre>
419+
&lt;style>
420+
#src { color: white; background: lime; width: 300px; height: 40px; }
421+
#dst { color: black; background: element(#src); padding: 20px; margin: 20px 0; }
422+
&lt;/style>
423+
&lt;p id='src'>I'm an ordinary element!&lt;/p>
424+
&lt;p id='dst'>I'm using the previous element as my background!&lt;/p></pre>
425+
426+
<img src="element-function.png" alt="">
417427
</div>
418428
</dd>
419429
</dl>

css3-images/element-function.png

7.65 KB
Loading

0 commit comments

Comments
 (0)