@@ -8,7 +8,7 @@ Group: csswg
8
8
ED : https://drafts.csswg.org/css-box-3/
9
9
TR : https://www.w3.org/TR/css-box-3/
10
10
Previous Version : https://www.w3.org/TR/2018/WD-css-box-3-20180802/
11
- Abstract : This specification describes the margin and padding properties, which create spacing in and around a CSS box. It may later be extended to include borders (currently described in [[css-backgrounds-3]]).
11
+ Abstract : This specification describes the margin and padding properties, which create spacing in and around a CSS box.
12
12
Editor : Elika J. Etemad / fantasai, Invited Expert, http://fantasai.inkedblade.net/contact, w3cid 35400
13
13
Ignored Terms : internal table elements, block layout
14
14
</pre>
@@ -349,96 +349,6 @@ Margin Shorthand: the 'margin' property {#margin-shorthand}
349
349
</pre>
350
350
</div>
351
351
352
- Margins at Container Edges: the 'margin-trim' property {#margin-trim}
353
- --------------------------
354
-
355
- <pre class="propdef">
356
- Name : margin-trim
357
- Value : none | in-flow | all
358
- Initial : none
359
- Applies to : [=block containers=], [=multi-column containers=]
360
- Inherited : no
361
- Percentages : N/A
362
- Computed value : keyword as specified
363
- Animation type : discrete
364
- </pre>
365
-
366
- Oftentimes, margins are desired between siblings,
367
- but not at the start/end of the container
368
- where spacing can be controlled with padding.
369
- This property allows the container
370
- to trim the margins of its children
371
- where they adjoin the container’s edges.
372
- Values have the following meanings:
373
-
374
- <dl dfn-type=value dfn-for=margin-trim>
375
- <dt> <dfn>none</dfn>
376
- <dd>
377
- Margins are not trimmed by the container.
378
-
379
- Note: However, in block layout,
380
- child margins can collapse with their parent.
381
- See <a href="https://www.w3.org/TR/CSS2/box.html#collapsing-margins">CSS2§8.3.1: Collapsing Margins</a> .
382
-
383
- <dt> <dfn>in-flow</dfn>
384
- <dd>
385
- For in-flow boxes contained by this box,
386
- block-axis margins adjacent to the box’s edges
387
- are truncated to zero.
388
- It also truncates any margins collapsed with such a margin.
389
-
390
- <dt> <dfn>all</dfn>
391
- <dd>
392
- Trims the margins of in-flow boxes as for ''in-flow'' ,
393
- but also trims any float margin
394
- whose [=margin edge=] coincides
395
- with the container’s [=content edge=] .
396
- </dl>
397
-
398
- Specifically, for [=block containers=] ,
399
- ''margin-trim: in-flow'' or ''margin-trim: all'' discards:
400
- <ul>
401
- <li> The block-start margin of a block-level first child.
402
- <li> The block-end margin of a block-level last child.
403
- <li> Any margin collapsed with these margins.
404
- </ul>
405
-
406
- ''margin-trim: all'' also affects floats
407
- for which the [=block container=] is a [=containing block=] by:
408
- <ul>
409
- <li>
410
- Discarding the [=block-start=] [=margin=] of any float
411
- whose [=block-start=] [=outer edge=] coincides
412
- with the [=block-start=] [=inner edge=] of the container.
413
- <li>
414
- Discarding the [=inline-start=] /[=inline-end=] [=margin=]
415
- of an [=inline-start=] /[=inline-end=] float (or equivalent)
416
- whose [=outer edge=] on that side coincides
417
- with the [=inner edge=] of the container.
418
- <li>
419
- Zeroing the [=inline-axis=] margins of a float
420
- for the purpose of calculating its [=intrinsic size contributions=]
421
- or its [=size=] in the container’s [=inline axis=] .
422
- <li>
423
- Trimming the [=block-end=] margins of a float
424
- to the extent necessary to prevent such a margin
425
- from extending the [=block size=]
426
- of a [=block formatting context root=] .
427
- </ul>
428
-
429
- ISSUE: Should this property apply to [=flex containers=] or [=grid containers=] ?
430
-
431
- ISSUE: Should floats have a <css> floats</css> value that only affects floats?
432
-
433
- Note: See also the 'margin-break' property,
434
- which applies to the box’s own margins
435
- when they adjoin a <a>fragmentation break</a>
436
- (page break / column break / etc.).
437
-
438
- ISSUE: Define how this property affects margins at breaks
439
- if the box establishes a <a>fragmentation context</a> .
440
- See also <a href="https://github.com/w3c/csswg-drafts/issues/3314">Issue 3314</a> .
441
-
442
352
Padding {#paddings}
443
353
=======
444
354
@@ -551,7 +461,6 @@ Changes Since CSS Level 2 {#changes}
551
461
The following changes have been made to this module
552
462
since <a href="https://www.w3.org/TR/CSS2/box.html">CSS Level 2</a> :
553
463
<ul>
554
- <li> Adding the 'margin-trim' property.
555
464
<li> Adapting the prose slightly to account for vertical <a>writing modes</a> .
556
465
</ul>
557
466
0 commit comments