From f485e5f27b2b4c9b1021914d05717fe7ac9486cb Mon Sep 17 00:00:00 2001
From: Florian Rivoal This module extends the 'width', 'height', 'min-width', 'min-height', 'max-width', 'max-height', and 'column-width'
features defined in [[!CSS2]] chapter 10 and in [[!CSS3COL]]
+ The definition of the 'box-sizing' property in module supersedes the one in [[CSS-UI-3]].
+
+
Box Edges for Sizing: the 'box-sizing' property
From c5c14122aeda1514b29951718d0bc0b9d7affe8c Mon Sep 17 00:00:00 2001
From: Florian Rivoal
Values
diff --git a/css-ui-4/Overview.bs b/css-ui-4/Overview.bs
index f2320bc3bf4..2ebf929af74 100644
--- a/css-ui-4/Overview.bs
+++ b/css-ui-4/Overview.bs
@@ -140,196 +140,14 @@ which itself replaced and superseded the following:
User Interface for CSS3 (16 February 2000) [[CSS-UI-3]]
+One feature previously defined in [[CSS-UI-3]] has been moved to [[CSS-SIZING-3]] rather than this specification.
Box Model addition
Changing the Box Model: the 'box-sizing' property
-
-Name: box-sizing
-Value: content-box | border-box
-Initial: content-box
-Applies to: all elements that accept width or height
-Inherited: no
-Percentages: N/A
-Media: visual
-Computed value: specified value
-
-
-
-
-
-Note: In contrast to the length and percentage values,
-the ''width/auto'' value of the 'width' and 'height' properties
-(as well as other keyword values introduced by later specifications,
-unless otherwise specified)
-is not influenced by the 'box-sizing' property,
-and always sets the size of the content box.
-
-The following terms, whose definitions vary based on the computed value of 'box-sizing' are introduced:
-
-
-
-
-The Visual formatting model details of [[!CSS21]] are written assuming ''box-sizing: content-box''. The following disambiguations are made to clarify the behavior for all values of 'box-sizing':
-
-
-
- ''box-sizing: content-box''
- ''box-sizing: border-box''
-
-
- min inner width
- 'min-width'
- max(0, 'min-width' − 'padding-left' − 'padding-right' − 'border-left-width' − 'border-right-width')
-
-
- max inner width
- 'max-width'
- max(0, 'max-width' − 'padding-left' − 'padding-right' − 'border-left-width' − 'border-right-width')
-
-
- min inner height
- 'min-height'
- max(0, 'min-height' − 'padding-top' − 'padding-bottom' − 'border-top-width' − 'border-bottom-width')
-
-
- max inner height
- 'max-height'
- max(0, 'max-height' − 'padding-top' − 'padding-bottom' − 'border-top-width' − 'border-bottom-width')
-
-
-
-width
in the following phrase is to be interpreted as content width:
- If 'width' is not ''width/auto'' and 'border-left-width' + 'padding-left' + 'width' + [...]
-
- width
is to be interpreted as content width in the following equation:
- 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + [...]
-
- width
, height
, min-width
, max-width
, min-height
and max-height
- are respectively to be interpreted as
- content width, content height, min inner width, max inner width, min inner height and max inner height in the following phrases:
-
-
-
-
- The tentative used width is calculated [...]
-
- If the tentative used width is greater than 'max-width',
- the rules above are applied again,
- but this time using the computed value of 'max-width' as the computed value for 'width'.
-
- If the resulting width is smaller than 'min-width',
- the rules above are applied again,
- but this time using the value of 'min-width' as the computed value for 'width'.
-
- Select from the table the resolved height and width values for the appropriate constraint violation.
- Take the max-width and max-height as max(min, max) so that min ≤ max holds true.
- In this table w and h stand for the results of the width and height computations [...]
-
- Then apply the rules under "Calculating widths and margins" above, as if 'width' were computed as this value.
- height
is to be interpreted as content height in the following equation:
- 'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + [...]
-
- width
, height
, min-height
and max-height
- are respectively to be interpreted as
- content width, content height, min inner height and max inner height in the following phrases:
-
-
-
-The tentative used height is calculated [...]
-
- If this tentative height is greater than 'max-height',
- the rules above are applied again, but this time using the value of 'max-height' as the computed value for 'height'.
-
- If the resulting height is smaller than 'min-height',
- the rules above are applied again,
- but this time using the value of 'min-height' as the computed value for 'height'.
-
- [...] use the algorithm under Minimum and maximum widths above to find the used width and height.
- Then apply the rules under "Computing heights and margins" above,
- using the resulting width and height as if they were the computed values.
- Using box-sizing to evenly share space
-
- This example uses box-sizing to evenly horizontally split
- two divs with fixed size borders inside a div container,
- which would otherwise require additional markup.
-
- sample CSS:
-
-
- sample HTML fragment:
-
- div.container {
- width:38em;
- border:1em solid black;
- }
-
- div.split {
- box-sizing:border-box;
- width:50%;
- border:1em silver ridge;
- float:left;
- }
-
-
- demonstration of sample CSS and HTML:
-
- <div class="container">
- <div class="split">This div occupies the left half.</div>
- <div class="split">This div occupies the right half.</div>
- </div>
- Outline properties
From 1cc1811a850a7c2d1c3d9b896c0644b186214369 Mon Sep 17 00:00:00 2001
From: Florian Rivoal Box Model addition
-
-Changing the Box Model: the 'box-sizing' property
-
+Note:
+
+
+
+
+
+
+
+
+
+
+
The 'box-sizing' property was previously defined in this section of the specification,
-but has been moved to the [[CSS-SIZING-3#box-sizing]].
+but has been moved to [[CSS-SIZING-3#box-sizing]].
Outline properties