@@ -356,101 +356,48 @@ <h2 id=background><span class=secno>3. </span>Background properties</h2>
356356 < h3 id =layering > < span class =secno > 3.1 </ span > Layering multiple background
357357 images</ h3 >
358358
359- < p > The background of a box can have multiple layers in CSS3. The properties
359+ < p > The background of a box can have multiple layers in CSS3. The number of
360+ layers is determined by the number of comma-separated values in the
360361 ‘< code class =property > < a
361- href ="#background-image "> background-image</ a > </ code > ’, ‘< code
362- class =property > < a
363- href ="#background-origin "> background-origin</ a > </ code > ’,
364- ‘< code class =property > < a
365- href ="#background-clip "> background-clip</ a > </ code > ’, ‘< code
366- class =property > < a
367- href ="#background-repeat "> background-repeat</ a > </ code > ’,
368- ‘< code class =property > < a
369- href ="#background-size "> background-size</ a > </ code > ’, and
370- ‘< code class =property > < a
371- href ="#background-position "> background-position</ a > </ code > ’ may have
372- multiple comma-separated values. If the values are specified as follows:
362+ href ="#background-image "> background-image</ a > </ code > ’ property. Note
363+ that a value of ‘< code class =property > none</ code > ’ still
364+ creates a layer.
373365
374- < blockquote >
375- < p > background-image: < var > w</ var > < sub > 1</ sub > , < var > w</ var > < sub > 2</ sub > ,
376- < var > w</ var > < sub > 3</ sub > ,…,
377- < var > w</ var > < sub > < var > M</ var > </ sub > < br >
378- background-repeat: < var > x</ var > < sub > 1</ sub > , < var > x</ var > < sub > 2</ sub > ,
379- < var > x</ var > < sub > 3</ sub > ,…,
380- < var > x</ var > < sub > < var > R</ var > </ sub > < br >
381- background-size: < var > y</ var > < sub > 1</ sub > , < var > y</ var > < sub > 2</ sub > ,
382- < var > y</ var > < sub > 3</ sub > ,…,
383- < var > y</ var > < sub > < var > S</ var > </ sub > < br >
384- background-position: < var > s</ var > < sub > 1</ sub > , < var > s</ var > < sub > 2</ sub > ,
385- < var > s</ var > < sub > 3</ sub > ,…, < var > s</ var > < sub > < var > P</ var > </ sub >
386- </ blockquote >
387-
388- < p > then the number of layers is < var > N</ var > = max(< var > M</ var > ,
389- < var > R</ var > , < var > S</ var > , < var > P</ var > )
390-
391- < p > Each of the properties is interpreted as if it had < var > N</ var > values,
392- by repeating the specified values like this:
393-
394- < blockquote >
395- < p > background-image:
396- < var > w</ var > < sub > 1</ sub > ,…< var > w</ var > < sub > < var > M</ var > </ sub > ,
397- < var > w</ var > < sub > 1</ sub > ,…< var > w</ var > < sub > < var > M</ var > </ sub > ,
398- < var > w</ var > < sub > 1</ sub > ,… /* < var > N</ var > values */< br >
399- background-repeat:
400- < var > x</ var > < sub > 1</ sub > ,…< var > x</ var > < sub > < var > R</ var > </ sub > ,
401- < var > x</ var > < sub > 1</ sub > ,…< var > x</ var > < sub > < var > R</ var > </ sub > ,
402- < var > x</ var > < sub > 1</ sub > ,… /* < var > N</ var > values */< br >
403- background-size:
404- < var > y</ var > < sub > 1</ sub > ,…< var > y</ var > < sub > < var > S</ var > </ sub > ,
405- < var > y</ var > < sub > 1</ sub > ,…< var > y</ var > < sub > < var > S</ var > </ sub > ,
406- < var > y</ var > < sub > 1</ sub > ,… /* < var > N</ var > values */< br >
407- background-position:
408- < var > s</ var > < sub > 1</ sub > ,…< var > r</ var > < sub > < var > P</ var > </ sub > ,
409- < var > s</ var > < sub > 1</ sub > ,…< var > r</ var > < sub > < var > P</ var > </ sub > ,
410- < var > s</ var > < sub > 1</ sub > ,… /* < var > N</ var > values */
411- </ blockquote >
366+ < p > Each of the images is repeated, sized, and positioned according to the
367+ corresponding value in the other background properties. The lists are
368+ matched up from the first value: excess values at the end are not used. If
369+ a property doesn't have enough comma-separated values to match the number
370+ of layers, the UA must calculate its used value by repeating the list of
371+ values until there are enough.
412372
413373 < div class =example >
414- < p > This set of declarations:
374+ < p > For example, this set of declarations:
415375
416376 < pre >
417377background-image: url(flower.png), url(ball.png), url(grass.png);
418- background-position: center center, 20% 80%, top left;
378+ background-position: center center, 20% 80%, top left, bottom right ;
419379background-origin: border-box, content-box;
380+ background-repeat: no-repeat;
420381</ pre >
421382
422- < p > has exactly the same effect as this set with the origin values repeated
423- (displayed in bold for clarity):
383+ < p > has exactly the same effect as this set with the extra position dropped
384+ and the missing values for ‘< code class =property > < a
385+ href ="#background-origin "> background-origin</ a > </ code > ’ and
386+ ‘< code class =property > < a
387+ href ="#background-repeat "> background-repeat</ a > </ code > ’ filled in
388+ (emphasized for clarity):
424389
425390 < pre >
426391background-image: url(flower.png), url(ball.png), url(grass1.png);
427392background-position: center center, 20% 80%, top left;
428- background-origin: border-box, content-box< b > , border-box</ b > ;
429- </ pre >
430-
431- < p > Likewise, this set of declarations:
432-
433- < pre >
434- background-image: url(red.png), url(blue.png);
435- background-repeat: repeat-x, repeat-y, repeat-y;
436- background-position: 20% 25%, 40% 10%, 50% 15%, 70% 40%, 90% 35%;
437- </ pre >
438-
439- < p > has the same effect as:
440-
441- < pre >
442- background-image: url(red.png), url(blue.png)< b > , url(red.png),</ b >
443- < b > url(blue.png), url(red.png)</ b > ;
444- background-repeat: repeat-x, repeat-y, repeat-y< b > , repeat-x, repeat-y</ b > ;
445- background-position: 20% 25%, 40% 10%, 50% 15%, 70% 40%, 90% 35%;
393+ background-origin: border-box, content-box< strong > , border-box</ strong > ;
394+ background-repeat: no-repeat< strong > , no-repeat, no-repeat</ strong > ;
446395</ pre >
447396 </ div >
448397
449- < p > Each of the images is repeated, sized, and positioned according to the
450- corresponding value in the other properties. The first image in the list
451- is the layer closest to the user, the next one is painted behind the
452- first, and so on. The background color, if present, is painted below all
453- of the other layers.
398+ < p > The first image in the list is the layer closest to the user, the next
399+ one is painted behind the first, and so on. The background color, if
400+ present, is painted below all of the other layers.
454401
455402 < h3 id =the-background-color > < span class =secno > 3.2 </ span > The ‘< code
456403 class =property > < a
@@ -504,9 +451,7 @@ <h3 id=the-background-color><span class=secno>3.2 </span>The ‘<code
504451 instead of the first color in the case the element's specified bottom-most
505452 background image, if any, fails to load or cannot be displayed (e.g.
506453 because it is in an unsupported format or is corrupted in some way). This
507- color is called the < dfn id =fallback > fallback color.</ dfn > If the color
508- before the slash is missing, it is assumed to be ‘< code
509- class =css > transparent</ code > ’.
454+ color is called the < dfn id =fallback > fallback color.</ dfn >
510455
511456 < div class =example >
512457 < p > Example:
@@ -1041,11 +986,6 @@ <h3 id=the-background-position><span class=secno>3.6 </span>The
1041986 background-position: left 10px top ; /* 10px, 0px */</ pre >
1042987 </ div >
1043988
1044- < div class =issue >
1045- < p > Is this a reasonable syntax for specifying offsets from the bottom
1046- right corner? What do people think?</ p >
1047- </ div >
1048-
1049989 < dl >
1050990 < dt > < dfn id =position-percentage > <percentage></ dfn >
1051991
0 commit comments