Skip to content

Commit 6d2d8b3

Browse files
committed
Changed the spriting example to use an actual image.
1 parent d3a4005 commit 6d2d8b3

3 files changed

Lines changed: 58 additions & 12 deletions

File tree

css3-images/Overview.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,17 @@ <h3 id=url><span class=secno>4.1. </span> Image References and Image
414414
rel=biblioentry>[MEDIA-FRAGS]<!--{{!MEDIA-FRAGS}}--></a>
415415

416416
<div class=example>
417-
<p>For example,</p>
417+
<p>For example, given the following image* and CSS:</p>
418+
<a href=sprites.svg> <img alt="[9 circles, with 0 to 8 eighths filled in]"
419+
height=20 src=sprites.svg width=180> </a>
420+
<pre>background-image: url('sprites.svg#xywh=40,0,20,20')</pre>
418421

419-
<pre>background-image: url('sprites.png#xywh=10,30,60,20')</pre>
422+
<p>...the background of the element will be the portion of the image that
423+
starts at (40px,0px) and is 20px wide and tall, which is just the circle
424+
with a quarter filled in.</p>
420425

421-
<p>uses the 60 pixel by 20 pixel rectangle of <code>sprites.png</code>
422-
beginning at the point 10 pixels in from the left, 30 pixels down from
423-
the top.
426+
<p><small>* SVG-in-&lt;img> support required. Click the picture to view
427+
the SVG directly.</small></p>
424428
</div>
425429

426430
<p class=note>Note however that a UA that doesn't understand the media
@@ -435,7 +439,7 @@ <h3 id=url><span class=secno>4.1. </span> Image References and Image
435439
<p>In the example below, the &lsquo;<code class=css>image()</code>&rsquo;
436440
notation is used together with the media fragment syntax, so that UAs
437441
that don't support media fragments fail to parse the second declaration
438-
and use the first.
442+
and use the first.</p>
439443

440444
<pre>
441445
<!-- -->background-image: url('swirl.png'); /* old UAs */

css3-images/Overview.src.html

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,18 @@ <h3 id="url">
208208
[[!MEDIA-FRAGS]]
209209

210210
<div class="example">
211-
<p>For example,</p>
211+
<p>For example, given the following image* and CSS:</p>
212212

213-
<pre>background-image: url('sprites.png#xywh=10,30,60,20')</pre>
213+
<a href="sprites.svg">
214+
<img src="sprites.svg" height="20" width="180" alt="[9 circles, with 0 to 8 eighths filled in]">
215+
</a>
214216

215-
<p>uses the 60 pixel by 20 pixel rectangle of <code>sprites.png</code> beginning
216-
at the point 10 pixels in from the left, 30 pixels down from the top.
217+
<pre>background-image: url('sprites.svg#xywh=40,0,20,20')</pre>
218+
219+
<p>...the background of the element will be the portion of the image that starts at (40px,0px)
220+
and is 20px wide and tall, which is just the circle with a quarter filled in.</p>
221+
222+
<p><small>* SVG-in-&lt;img> support required. Click the picture to view the SVG directly.</small></p>
217223
</div>
218224

219225
<p class="note">Note however that a UA that doesn't understand the media
@@ -226,11 +232,11 @@ <h3 id="url">
226232
<div class="example">
227233
<p>In the example below, the ''image()'' notation is used together with
228234
the media fragment syntax, so that UAs that don't support media fragments
229-
fail to parse the second declaration and use the first.
235+
fail to parse the second declaration and use the first.</p>
236+
230237
<pre>
231238
<!-- -->background-image: url('swirl.png'); /* old UAs */
232239
<!-- -->background-image: image('sprites.png#xywh=10,30,60,20'); /* new UAs */</pre>
233-
</div>
234240
</div>
235241

236242
<!-- ====================================================================== -->

css3-images/sprites.svg

Lines changed: 36 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)