CSS2 Test Suite: 8.3 margin

[index page] [section] [Previous] [Next] [Specification]

The style declarations contained within this page:

.test {background-color: silver;}
.cl1 {margin: 10px;}
.cl2 {margin: 15px;}
.cl3 {margin: 1em;}
.cl4 {margin: -2px; background-color: aqua;}
.cl5 {margin: 10px 20px 0 -5px;}
.cl6 {margin: 10px 20px 0;}
.cl7 {margin: 10px 20px;}


[test] This 'div' element has no margins applied to it, and acts as a reference point.
[test cl1] This 'div' element should have an overall margin of 10 pixels.
[test cl2] This 'div' element should have an overall margin of 15 pixels.
[test cl3] This 'div' element should have an overall margin of 1em.
[test cl4] This 'div' element should have an overall margin of -2 pixels, and an aqua background.
[test cl5] This 'div' element should have margins of 10px top, 20px right, 0 bottom, and -5px left.
[test cl6] This 'div' element should have margins of 10px top, 20px right, 0 bottom, and 20px left.
[test cl7] This 'div' element should have margins of 10px top, 20px right, 10px bottom, and 20px left.
[test] This 'div' element contains a 'span' element with a class of 'cl5' that should appear to have no top or bottom margins, but a 20px right margin and a -5px left margin. If there is [cl5]any increase of line separation in the 'div' element due to the top and bottom margins on the 'span' element, the test has been failed; margins do not affect the height of lines.

[index page] [section] [Previous] [Next] [Specification]