@@ -99,7 +99,7 @@ Link Defaults: css-transforms-1 (property) transform
99
99
</style>
100
100
101
101
<pre class=anchors>
102
- urlPrefix: https://www.w3.org/TR/CSS2/visuren.html; spec: CSS2;
102
+ urlPrefix: https://www.w3.org/TR/CSS2/visuren.html; spec: CSS2;
103
103
url: #normal-flow; text: normal flow; type: dfn;
104
104
url: #x1; text: viewport; type: dfn;
105
105
urlPrefix: https://www.w3.org/TR/CSS21/media.html; spec: CSS2;
@@ -130,7 +130,7 @@ Introduction</h2>
130
130
* [=Sticky positioning=] , which visually shifts a box relative to its laid-out location
131
131
in order to keep it visible when a scrollable ancestor
132
132
would otherwise scroll it out of sight.
133
- * [=Absolute positioning=] , which ignores normal layout entirely,
133
+ * [=Absolute positioning=] , which ignores normal layout entirely,
134
134
pulling the element [=out of flow=] and
135
135
positioning it relative to its [=containing block=]
136
136
with no regard for other content.
@@ -150,7 +150,7 @@ Introduction</h2>
150
150
<h3 id="placement">
151
151
Module Interactions</h3>
152
152
153
- This module replaces and extends the [=positioning scheme=] features
153
+ This module replaces and extends the [=positioning scheme=] features
154
154
defined in [[!CSS2]] sections:
155
155
156
156
<ul>
@@ -326,7 +326,7 @@ Containing Blocks of Positioned Boxes</h3>
326
326
</dl>
327
327
328
328
If no ancestor establishes one,
329
- the [=absolute positioning containing block=] is
329
+ the [=absolute positioning containing block=] is
330
330
the [=initial containing block=] .
331
331
332
332
Note: Properties that can cause a box to establish
@@ -489,7 +489,7 @@ Box Insets: the 'top', 'right', 'bottom', 'left', 'inset-block-start', 'inset-in
489
489
in the corresponding axis
490
490
(e.g. width for 'left' or 'right' , height for 'top' and 'bottom' ).
491
491
For [=sticky positioned=] boxes,
492
- the inset is instead
492
+ the inset is instead
493
493
relative to the relevant [=scrollport=] ’s size.
494
494
Negative values are allowed.
495
495
@@ -544,6 +544,22 @@ Box Insets Shorthands: the 'inset-block', 'inset-inline', and 'inset' properties
544
544
assigning values to the longhands representing each side
545
545
exactly as the 'margin' property does for its longhands.
546
546
547
+ <div class=note>
548
+
549
+ By default, the 'inset' property values
550
+ are assigned to the corresponding <em> [=physical=] </em> [=longhand properties=] --
551
+ 'top' , 'right' , 'bottom' , and 'left' --
552
+ which for historical reasons do not have an <css> inset-</css> prefix.
553
+ This matches the behavior of other "4 values assigned to sides" properties,
554
+ such as 'margin' .
555
+
556
+ Allowing properties such as this to resolve to the [=flow-relative=] [=longhands=] is under discussion in [[CSS-LOGICAL-1]] .
557
+
558
+ Yes, we understand it's a little confusing
559
+ that 'inset' doesn't expand to any 'inset-*' properties.
560
+ </div>
561
+
562
+
547
563
548
564
<h3 id="relpos-insets" oldids="relpos">
549
565
Relative Positioning</h3>
@@ -607,7 +623,7 @@ Sticky positioning</h3>
607
623
in reference to the [=nearest scrollport=] .
608
624
609
625
For a [=sticky positioned=] [=box=] ,
610
- the [=inset properties=]
626
+ the [=inset properties=]
611
627
represent insets from the respective edges of the [=nearest scrollport=] ,
612
628
defining the <dfn export>sticky view rectangle</dfn>
613
629
used to constrain the box’s position.
@@ -670,7 +686,7 @@ Scroll Position of Sticky-Positioned Boxes</h4>
670
686
For example, if a user clicks a link targetting a [=sticky-positioned=] element,
671
687
even if the element's [=nearest scrollport=] is currently scrolled
672
688
such that the [=sticky positioned=] element is offset from its initial position,
673
- the [=scrollport=] will be scrolled back
689
+ the [=scrollport=] will be scrolled back
674
690
so that the element's initial position is visible.
675
691
</div>
676
692
@@ -712,7 +728,7 @@ Absolute (and Fixed) Positioning</h3>
712
728
(<var> containing block size</var> - 2 × |<var> start distance</var> |);
713
729
otherwise,
714
730
set the end-edge [=inset property=] to zero
715
- and the start-edge [=inset property=] to
731
+ and the start-edge [=inset property=] to
716
732
(<var> containing block size</var> - 2 × |<var> end distance</var> |).
717
733
</dl>
718
734
@@ -1162,7 +1178,7 @@ The width of absolute or fixed positioned, replaced elements</h3>
1162
1178
1163
1179
<li>
1164
1180
If at this point the values are over-constrained,
1165
- ignore the value for either 'left'
1181
+ ignore the value for either 'left'
1166
1182
(in case the 'direction' property of the <a>containing block</a> is ''rtl'' )
1167
1183
or 'right' (in case 'direction' is ''ltr'' )
1168
1184
and solve for that value.
@@ -1171,8 +1187,8 @@ The width of absolute or fixed positioned, replaced elements</h3>
1171
1187
<h3 id="abs-non-replaced-height">
1172
1188
The Height Of Absolutely Positioned, Non-Replaced Elements</h3>
1173
1189
1174
- For absolutely positioned elements,
1175
- the used values of the vertical dimensions
1190
+ For absolutely positioned elements,
1191
+ the used values of the vertical dimensions
1176
1192
must satisfy this constraint:
1177
1193
1178
1194
<code>
@@ -1181,95 +1197,95 @@ The Height Of Absolutely Positioned, Non-Replaced Elements</h3>
1181
1197
= <span> height of containing block</span>
1182
1198
</code>
1183
1199
1184
- If all three of 'top' , 'height' , and 'bottom' are ''top/auto'' :
1185
- First set any ''top/auto'' values for 'margin-top' and 'margin-bottom' to ''0'' ,
1186
- then set 'top' to the static position,
1200
+ If all three of 'top' , 'height' , and 'bottom' are ''top/auto'' :
1201
+ First set any ''top/auto'' values for 'margin-top' and 'margin-bottom' to ''0'' ,
1202
+ then set 'top' to the static position,
1187
1203
and finally apply rule number <em> three</em> below.
1188
1204
1189
- If none of the three are ''top/auto'' :
1205
+ If none of the three are ''top/auto'' :
1190
1206
If both 'margin-top' and 'margin-bottom' are ''top/auto'' ,
1191
- solve the equation under the extra constraint that the two margins get equal values.
1192
- If one of 'margin-top' or 'margin-bottom' is ''top/auto'' ,
1193
- solve the equation for that value.
1194
- If the values are over-constrained,
1207
+ solve the equation under the extra constraint that the two margins get equal values.
1208
+ If one of 'margin-top' or 'margin-bottom' is ''top/auto'' ,
1209
+ solve the equation for that value.
1210
+ If the values are over-constrained,
1195
1211
ignore the value for 'bottom' and solve for that value.
1196
1212
1197
- Otherwise,
1198
- set ''top/auto'' values for 'margin-top' and 'margin-bottom' to ''0'' ,
1213
+ Otherwise,
1214
+ set ''top/auto'' values for 'margin-top' and 'margin-bottom' to ''0'' ,
1199
1215
and pick one of the following six rules that apply.
1200
1216
1201
1217
1. If 'top' and 'height' are ''top/auto''
1202
- and 'bottom' is not ''top/auto'' ,
1203
- then the height is based on the
1218
+ and 'bottom' is not ''top/auto'' ,
1219
+ then the height is based on the
1204
1220
<a href="https://www.w3.org/TR/CSS2/visudet.html#root-height">Auto heights for block formatting context roots</a> ,
1205
1221
and solve for 'top' .
1206
1222
1207
- 2. If 'top' and 'bottom' are ''top/auto''
1208
- and 'height' is not ''top/auto'' ,
1209
- then set 'top' to the static position,
1223
+ 2. If 'top' and 'bottom' are ''top/auto''
1224
+ and 'height' is not ''top/auto'' ,
1225
+ then set 'top' to the static position,
1210
1226
then solve for 'bottom' .
1211
1227
1212
- 3. If 'height' and 'bottom' are ''top/auto''
1213
- and 'top' is not ''top/auto'' ,
1214
- then the height is based on the
1228
+ 3. If 'height' and 'bottom' are ''top/auto''
1229
+ and 'top' is not ''top/auto'' ,
1230
+ then the height is based on the
1215
1231
<a href="https://www.w3.org/TR/CSS2/visudet.html#root-height">Auto heights for block formatting context roots</a> ,
1216
1232
and solve for 'bottom' .
1217
1233
1218
- 4. If 'top' is ''top/auto'' ,
1219
- 'height' and 'bottom' are not ''top/auto'' ,
1234
+ 4. If 'top' is ''top/auto'' ,
1235
+ 'height' and 'bottom' are not ''top/auto'' ,
1220
1236
then solve for 'top' .
1221
1237
1222
- 5. If 'height' is ''top/auto'' ,
1223
- 'top' and 'bottom' are not ''top/auto'' ,
1238
+ 5. If 'height' is ''top/auto'' ,
1239
+ 'top' and 'bottom' are not ''top/auto'' ,
1224
1240
then solve for 'height' .
1225
1241
1226
- 6. If 'bottom' is ''top/auto'' ,
1227
- 'top' and 'height' are not ''top/auto'' ,
1242
+ 6. If 'bottom' is ''top/auto'' ,
1243
+ 'top' and 'height' are not ''top/auto'' ,
1228
1244
then solve for 'bottom' .
1229
1245
1230
1246
<h3 id="abs-replaced-height">
1231
1247
The Height Of Absolutely Positioned, Replaced Elements</h3>
1232
1248
1233
- If 'height' and 'width' both have computed values of ''top/auto''
1234
- and the element also has an intrinsic height,
1249
+ If 'height' and 'width' both have computed values of ''top/auto''
1250
+ and the element also has an intrinsic height,
1235
1251
then that intrinsic height is the used value of 'height' .
1236
1252
1237
- Otherwise, if 'height' has a computed value of ''top/auto''
1238
- and the element has an intrinsic ratio
1253
+ Otherwise, if 'height' has a computed value of ''top/auto''
1254
+ and the element has an intrinsic ratio
1239
1255
then the used value of 'height' is:
1240
1256
1241
1257
<code> (used width) / (intrinsic ratio)</code></p>
1242
1258
1243
- Otherwise, if 'height' has a computed value of ''top/auto''
1244
- and the element has an intrinsic height,
1259
+ Otherwise, if 'height' has a computed value of ''top/auto''
1260
+ and the element has an intrinsic height,
1245
1261
then that intrinsic height is the used value of 'height' .
1246
1262
1247
- Otherwise, if 'height' has a computed value of ''top/auto'' ,
1248
- but none of the conditions above are met,
1249
- then the used value of 'height' must be set to
1250
- the height of the largest rectangle that has a 2:1 ratio,
1251
- has a height not greater than ''150px'' ,
1263
+ Otherwise, if 'height' has a computed value of ''top/auto'' ,
1264
+ but none of the conditions above are met,
1265
+ then the used value of 'height' must be set to
1266
+ the height of the largest rectangle that has a 2:1 ratio,
1267
+ has a height not greater than ''150px'' ,
1252
1268
and has a width not greater than the device width.
1253
1269
1254
- After establishing the 'height' ,
1255
- in order to position the replaced element,
1270
+ After establishing the 'height' ,
1271
+ in order to position the replaced element,
1256
1272
apply the following rules as appropriate.
1257
1273
1258
- 1. If both 'top' and 'bottom' have the value ''top/auto'' ,
1274
+ 1. If both 'top' and 'bottom' have the value ''top/auto'' ,
1259
1275
replace 'top' with the element’s static position.
1260
1276
1261
- 2. If 'bottom' is ''top/auto'' ,
1277
+ 2. If 'bottom' is ''top/auto'' ,
1262
1278
replace any ''top/auto'' on 'margin-top' or 'margin-bottom'
1263
1279
with ''0'' .
1264
1280
1265
1281
3. If at this point both 'margin-top' and 'margin-bottom' are still ''top/auto'' ,
1266
- solve the equation under the extra constraint
1282
+ solve the equation under the extra constraint
1267
1283
that the two margins must get equal values.
1268
1284
1269
- 4. If at this point there is only one ''top/auto'' remaining,
1285
+ 4. If at this point there is only one ''top/auto'' remaining,
1270
1286
solve the equation for that value.
1271
1287
1272
- 5. If at this point the values are over-constrained,
1288
+ 5. If at this point the values are over-constrained,
1273
1289
ignore the value for 'bottom' and solve for that value.
1274
1290
1275
1291
<h2 id="comparison">
0 commit comments