Skip to content

Commit 71eb566

Browse files
committed
Clarify implications of two-value syntax for background-position. <http://lists.w3.org/Archives/Public/www-style/2012Mar/0124.html>
1 parent e1c3116 commit 71eb566

2 files changed

Lines changed: 19 additions & 10 deletions

File tree

css3-background/Overview.html

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,13 +1118,18 @@ <h3 id=the-background-position><span class=secno>3.6. </span>Positioning
11181118
]</pre>
11191119

11201120
<p>If only one value is specified, the second value is assumed to be
1121-
&lsquo;<code class=property>center</code>&rsquo;. If two values are given
1122-
and at least one value is not a keyword, then the first value represents
1123-
the horizontal position (or offset) and the second represents the vertical
1124-
position (or offset). <var>&lt;percentage&gt;</var> and
1125-
<var>&lt;length&gt;</var> values here represent an offset of the top left
1126-
corner of the background image from the top left corner of the background
1127-
positioning area.
1121+
&lsquo;<code class=property>center</code>&rsquo;. If two values are given,
1122+
a length or percentage as the first value represents the horizontal
1123+
position (or offset) and a length or percentage as the second value
1124+
represents the vertical position (or offset).
1125+
<var>&lt;percentage&gt;</var> and <var>&lt;length&gt;</var> values here
1126+
represent an offset of the top left corner of the background image from
1127+
the top left corner of the background positioning area.
1128+
1129+
<p class=note>Note that a pair of keywords can be reordered while a
1130+
combination of keyword and length or percentage cannot. So &lsquo;<code
1131+
class=css>center left</code>&rsquo; is valid while &lsquo;<code
1132+
class=css>50% left</code>&rsquo; is not.
11281133

11291134
<p>If three or four values are given, then each
11301135
<var>&lt;percentage&gt;</var> or<var>&lt;length&gt;</var> represents an

css3-background/Overview.src.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,14 +683,18 @@ <h3 id="the-background-position">Positioning Images: the 'background-position' p
683683
]</pre>
684684

685685
<p>If only one value is specified, the second value is assumed to be
686-
'center'. If two values are given and at least one value is not a keyword,
687-
then the first value represents the horizontal position (or offset) and
688-
the second represents the vertical position (or
686+
'center'. If two values are given, a length or percentage as the first
687+
value represents the horizontal position (or offset) and a length or
688+
percentage as the second value represents the vertical position (or
689689
offset). <var>&lt;percentage&gt;</var> and <var>&lt;length&gt;</var>
690690
values here represent an offset of the top left corner
691691
of the background image from the top left corner of the background
692692
positioning area.
693693

694+
<p class="note">Note that a pair of keywords can be reordered while
695+
a combination of keyword and length or percentage cannot.
696+
So ''center left'' is valid while ''50% left'' is not.
697+
694698
<p>If three or four values are given, then
695699
each <var>&lt;percentage&gt;</var> or<var>&lt;length&gt;</var>
696700
represents an offset and must be preceded by a keyword,

0 commit comments

Comments
 (0)