CSS2.1 Conformance Test Suite

Chapter 8 - Box model (238 tests)

Test Flags
8 Box model
8.1 Box dimensions
Margin backgrounds and transparency
Margins do not have a background, but show the content below them.
Margin, border, padding all display outside the content area A
Margin, border, padding render outside the content area.
Margin, border, padding all display outside the image area AG
Margin, border, padding render outside the image area.
Margin, border, padding all display outside the object area AG
Margin, border, padding render outside the object area.
Horizontal Formatting
8.2 Example of margins, padding, and borders
8.3 Margin properties: 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', and 'margin'
Margin on non-replaced inline elements
Non-replaced inline elements do not apply vertical margins.
Margin-top and margin-bottom on inline elements
Applying margin-top and margin-bottom to an inline element has no effect.
Margin with percentage determined by containing block
Potential circular reference cannot cause the user agent to crash or hang.
Vertical Formatting
Horizontal Formatting
Horizontal Formatting AG
margin-top AG
margin-top
margin-right AG
margin-right AG
margin-right
margin-right
margin-right AG
margin-right AG
margin-right AG
margin-right AG
margin-right
margin-right
margin-right
margin-bottom
margin-bottom
margin-left AG
margin-left AG
margin-left AG
margin-left
margin-left AG
margin-left AG
margin-left AG
margin-left AG
margin-left
margin-left
margin-left
margin AG
margin AG
margin
margin
margin AG
float AG
8.3.1 Collapsing margins
Margin collapsing - horizontal margins do not collapse A
Horizontal margins of element do not collapse.
Margin collapsing - maximum of the two adjoining margins AG
When margins collapse the margin is the maximum of the two margin widths.
Margin collapsing - negative margins adjoining positive margins
Negative margins deduct from the maximum of the adjoining positive margin.
Margin collapsing - negative margins deducted from zero
Negative margins are deducted from zero if no positive margins are adjoining.
Margin collapsing - adjoining margins of non-siblings or ancestors AG
Adjoining margin boxes generated by elements, that are not related by siblings or ancestors, collapse.
Margin collapsing - floated elements do not collapse margins AG
A floated box does not collapse its margins with any other box.
Margin collapsing - floated elements do not collapse margins with children AG
In-flow children of a floated element do not collapse margins.
Margin collapsing and elements with 'overflow' set to 'visible' AG
Elements with 'overflow' set to 'visible' collapse margin with in-flow children.
Margin collapsing and elements with 'overflow' set to 'hidden' A
Elements with 'overflow' set to 'hidden' do not collapse margin with in-flow children.
Margin collapsing and elements with 'overflow' set to 'scroll' A
Elements with 'overflow' set to 'scroll' do not collapse margin with in-flow children.
Margin collapsing and elements with 'overflow' set to 'auto' A
Elements with 'overflow' set to 'auto' do not collapse margin with in-flow children.
Margin collapsing - absolute positioning and siblings AG
Absolutely positioned boxes do not collapse margins with siblings.
Margin collapsing - absolute positioning with children elements AG
Absolutely positioned boxes do not collapse margins with any in-flow children.
Margin collapsing - inline-block elements as siblings AG
Inline-block elements that are siblings do not collapse their margins.
Margin collapsing - inline-block child does not collapse margins with parent AG
An element that is set in inline-block and its children set to inline-block do not collapse margins.
Margin collapsing - top/bottom margins adjoining collapse through AG
When top and bottom margins are adjoining margins collapse through that element.
Margin collapsing - parent edge and element edge are the same when margins collapse
When the margin top of a box collapses with the top margin of its parent the top edge is the same as the parent's.
Margin collapsing - element with clearance AG
An element that has clearance applied to it will not collapse its top margin with its parent's bottom margin.
Margin collapsing - elements that collapse margins have to effect on positions of other elements that also have margins that are collapsing AG
Positions of elements that have been collapsed through (empty elements) have no effect on positions of other elements whose margins are being collapsed.
Margin collapsing with the root element AG
For HTML pages the html element does not collapse its margins with other elements.
Margin collapsing with the 'body' element AG
For HTML pages the 'body' element's margins collapse.
Margin collapsing - adjoining block boxes AG
Bottom margin of an in-flow block-level element is always adjoining to the top margin of its next in-flow block-level sibling.
Margin collapsing - clearance applied to sibling AG
If a block-level sibling has clearance then the bottom margin of its previous sibling will not be adjoining its top margin.
Margin collapsing - in-flow block-level margin adjoining child's margin AG
When an in-flow block-level element is adjoining its in-flow block-level child's top margin and the child has no top border, top padding or clearance then collapse.
Margin collapsing - in-flow block-level margins with an element 'height' of 'auto' and 'min-height' of zero AG
An element's margins are adjoining and can collapse if the 'min-height' is zero, there are no vertical borders or padding, it has a 'height' of zero or 'auto', it has no line boxes and all of its in-flow children's margins are adjoining.
Margin collapsing - bottom margin not collapse when cleared AG
Top margins collapse to siblings and bottom margin do not collapse when own margins collapse and clearance is applied.
Margin collapsing is based on used values of 'padding', 'margin' and 'border' AG
Collapsing of margins is based on the used values of 'padding', 'margin' and 'border'.
Margin Collapsing with Clearance
Margin Collapsing with Clearance
Margin Collapsing with Clearance
Margin Collapsing with Clearance
Margin Collapsing with Clearance
Margin Collapsing with Clearance
Margin Collapsing with Clearance
Margin Collapsing with Clearance
Margin Collapsing with Clearance
Margin Collapsing with Clearance
Margin Collapsing with Clearance
Margin Collapsing with Clearance
Vertical Formatting
8.4 Padding properties: 'padding-top', 'padding-right', 'padding-bottom', 'padding-left', and 'padding'
Padding background defined by the background property
The background for the padding area is defined by the background property.
Padding with percentage determined by containing block
Potential circular reference cannot cause the user agent to crash or hang.
Explicit Inheritance
Vertical Formatting
Horizontal Formatting
margin-right
margin-left
padding-top
padding-top
padding-top
padding-top
padding-right AG
padding-right AG
padding-right AG
padding-right
padding-right AG
padding-right AG
padding-right
padding-right
padding-right
padding-bottom
padding-bottom
padding-bottom
padding-bottom
padding-left AG
padding-left AG
padding-left AG
padding-left
padding-left AG
padding-left AG
padding-left
padding-left
padding-left G
padding AG
padding AG
padding
padding
8.5 Border properties
Explicit Inheritance
Horizontal Formatting
margin-right
margin-left
padding-right
border-top-width
border-top-width
border-top-width G
border-top-width
border-top-width
border-right-width
border-right-width
border-right-width G
border-right-width
border-right-width
border-bottom-width
border-bottom-width
border-bottom-width G
border-bottom-width
border-bottom-width
border-left-width
border-left-width
border-left-width G
border-left-width
border-left-width
border-width
border-width
border-width G
border-width
border-color
border-color
border-style
border-style
border-top
border-top
border-top
border-right
border-right
border-right
border-right
border-bottom
border-bottom
border-bottom
border-left
border-left
border-left
border-left
border
border
border G
border
8.5.1 Border width: 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width', and 'border-width'
Border-width - Relation of thin, medium, and thick
A border-width set to thin is small than a border-width that is set to medium which is smaller than a border-width that is set to thick.
Border-width set using a single value
Applying a single value to the 'border-width' property applies the value to all sides of the element.
Border-width set using two values
Applying two values to the border-width property applies the first value to the top and bottom and the second to the left and right.
Border-width set using three values
Applying three values to the border-width property applies the first value to the top. The second value to the left and right and the third value to the bottom.
Border-width set using four values
Applying four values to the border-width property applies the values top, right, bottom, left, respectively.
8.5.2 Border color: 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color', and 'border-color'
Border-color shorthand - one value
Specifying a single value on the 'border-color' property sets the value for all sides of the element.
Border-color shorthand - two values
Specifying two values on the 'border-color' property assigns the first value to the top and bottom and the second to the left and right.
Border-color shorthand - three values
Specifying three values to the 'border-color' property assigns the first value to the top the second value to the left and right and the third value to the bottom.
Border-color shorthand - four values
Specifying four values to the 'border-color' property assigns the values for top, right, bottom and left.
Border-style initial set to 'none'
Verify that 'border-color' and 'border-width' do not display a border since 'border-style' is initially 'none'.
Border-style set using three values
Applying three values to the border-style property applies the first value to the top the second value to the left and right and the third value to the bottom.
8.5.3 Border style: 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style', and 'border-style'
Border-style 'groove' color rendering
The 'groove' 'border-style' uses the color defined for rendering the groove border.
Border-style 'ridge' color rendering
The 'ridge' 'border-style' uses the color defined for rendering the ridge border.
Border-style 'inset' color rendering
The 'inset' 'border-style' uses the color defined for rendering the inset border.
Border-style 'outset' color rendering
The 'outset' 'border-style' uses the color defined for rendering the outset border.
Border-style set using one value
Applying a single value to the border-style property applies the value to all sides of the element.
Border-style set using two values
Applying two values to the border-style property applies the first value to the top and bottom and the second to the left and right.
Border-style set using four values
Applying four values to the border-style property applies the values top, right, bottom, left, respectively.
Double lines border style does not change border width
The 'double' 'border-style' does not change the size of the border width. The sum of the two lines and the space need to equal the border width.
8.5.4 Border shorthand properties: 'border-top', 'border-right', 'border-bottom', 'border-left', and 'border'
8.6 The box model for inline elements in bidirectional context
Borders drawn in visual order even when direction set to left-to-right AG
Borders are drawn in visual order depending on the direction of content.
Borders drawn in visual order even when direction set to right-to-left
Borders are drawn in visual order depending on the direction of content.
direction and borders - normal
Borders should be unaffected by directionality
bidirection box model - borders on inline in normal block
Border sides should be unaffected by directionality
bidirection box model - borders on inline in embed block
Border sides should be unaffected by directionality
bidirection box model - borders on inline in bidi-override block
Border sides should be unaffected by directionality
bidirection box model - borders on normal inline
Border sides should be unaffected by directionality
bidirection box model - borders on embed inline
Border sides should be unaffected by directionality
bidirection box model - borders on bidi-override inline
Border sides should be unaffected by directionality
bidirection box model - borders on normal block
Border sides should be unaffected by directionality
bidirection box model - borders on embed block
Border sides should be unaffected by directionality
bidirection box model - borders on bidi-override block
Border sides should be unaffected by directionality
bidirection box model - margin-left on bidi-override inline
Side margins should be unaffected by directionality
bidirection box model - margin-left on normal inline
Side margins should be unaffected by directionality
bidirection box model - margin-left on embed inline
Side margins should be unaffected by directionality
bidirection box model - margin-left on inline in bidi-override block
Side margins should be unaffected by directionality
bidirection box model - margin-left on inline in normal block
Side margins should be unaffected by directionality
bidirection box model - margin-left on inline in embed block
Side margins should be unaffected by directionality
bidirection box model - margin-left on bidi-override block
Side margins should be unaffected by directionality
bidirection box model - margin-left on normal block
Side margins should be unaffected by directionality
bidirection box model - margin-left on embed block
Side margins should be unaffected by directionality
bidirection box model - margin-right on bidi-override inline
Side margins should be unaffected by directionality
bidirection box model - margin-right on normal inline
Side margins should be unaffected by directionality
bidirection box model - margin-right on embed inline
Side margins should be unaffected by directionality
bidirection box model - margin-right on inline in bidi-override block
Side margins should be unaffected by directionality
bidirection box model - margin-right on inline in normal block
Side margins should be unaffected by directionality
bidirection box model - margin-right on inline in embed block
Side margins should be unaffected by directionality
bidirection box model - margin-right on bidi-override block
Side margins should be unaffected by directionality
bidirection box model - margin-right on normal block
Side margins should be unaffected by directionality
bidirection box model - margin-right on embed block
Side margins should be unaffected by directionality
bidirection box model - padding-left on bidi-override inline
Side padding should be unaffected by directionality
bidirection box model - padding-left on inline in normal block
Side padding should be unaffected by directionality
bidirection box model - padding-left on inline in embed block
Side padding should be unaffected by directionality
bidirection box model - padding-left on inline in bidi-override block
Side padding should be unaffected by directionality
bidirection box model - padding-left on normal inline
Side padding should be unaffected by directionality
bidirection box model - padding-left on embed inline
Side padding should be unaffected by directionality
bidirection box model - padding-left on bidi-override block
Side padding should be unaffected by directionality
bidirection box model - padding-left on normal block
Side padding should be unaffected by directionality
bidirection box model - padding-left on embed block
Side padding should be unaffected by directionality
bidirection box model - padding-right on bidi-override inline
Side padding should be unaffected by directionality
bidirection box model - padding-right on inline in normal block
Side padding should be unaffected by directionality
bidirection box model - padding-right on inline in embed block
Side padding should be unaffected by directionality
bidirection box model - padding-right on inline in bidi-override block
Side padding should be unaffected by directionality
bidirection box model - padding-right on normal inline
Side padding should be unaffected by directionality
bidirection box model - padding-right on embed inline
Side padding should be unaffected by directionality
bidirection box model - padding-right on bidi-override block
Side padding should be unaffected by directionality
bidirection box model - padding-right on normal block
Side padding should be unaffected by directionality
bidirection box model - padding-right on embed block
Side padding should be unaffected by directionality