CSS2 Test Suite: 10.3.4 Computing widths and margins: block-level, replaced elements in normal flow

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

The style declarations contained within this page:

img {display: block; height: 15px;}
img.cl1 {margin-right: auto; margin-left: auto; width: auto;}
img.cl2 {margin-right: auto; margin-left: auto; width: 50%;}
img.cl3 {margin-right: 0; margin-left: auto; width: 25px;}


The following image, which has a class of 'cl1', should be its intrinsic width (15 pixels) and centered in the content area of its parent element.

test image

The following image, which has a class of 'cl2', should be half the width of its parent element and centered in the content area of its parent element.

test image

The following image, which has a class of 'cl3', should be 25 pixels wide and its right edge should abut the right edge of the content area of its parent element.

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