CSS1 Test Suite: 5.5.05 margin


[Previous] [Next] [Section] [Contents] [Specification]
Last Updated: 11 May 1998

The style declarations which apply to the text below are:

.one {margin: 0.5in;}
.two {margin: 25px;}
.three {margin: 5em;}
.four {margin: 25%;}
.five {margin: auto; width: 50%; background-color: gray;}
.six {margin-left: auto; margin-right: auto; width: 50%; background-color: gray;}
.seven {margin: auto; width: 100%; background-color: gray;}

This sentence should have an overall margin of half an inch, which will require extra text in order to test.

This sentence should have an overall margin of 25 pixels, which will require extra text in order to test.

This sentence should have an overall margin of 5 em, which will require extra text in order to test.

This sentence should have an overall margin of 25%, which will require extra text in order to test.

This whole element (not the text itself) should be centered within its parent, due to 'auto' settings on the element's margin.

This whole element (not the text itself) should be centered within its parent as well, due to 'auto' settings on the element's left and right margins.

This element should NOT be centered, because its width is defined as 100% (but this can only be considered compliant if the previous two elements are centered).

This sentence should have an overall margin of half an inch, which will require extra text in order to test.

This sentence should have an overall margin of 25 pixels, which will require extra text in order to test.

This sentence should have an overall margin of 5 em, which will require extra text in order to test.

This sentence should have an overall margin of 25%, which will require extra text in order to test.

This whole element (not the text itself) should be centered within its parent, due to 'auto' settings on the element's margin.

This whole element (not the text itself) should be centered within its parent as well, due to 'auto' settings on the element's left and right margins.

This element should NOT be centered, because its width is defined as 100% (but this can only be considered compliant if the previous two elements are centered).


[Previous] [Next] [Section] [Contents] [Specification]