CSS2 Test Suite: 10.3.2 Computing widths and margins: inline, replaced elements

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

The style declarations contained within this page:

.bookend {background: #FCC;}
.test {background: #9F9;}
.cl1 {width: 30px;}
.cl2 {padding: 0 10px;}
.cl3 {border: 10px solid green; border-width: 0 10px;}
.cl4 {margin: 0 10px;}
.cl5 {width: 30px; padding: 0 10px; border: 10px solid green; border-width: 0 10px; margin: 0 10px;}
.cl6 {width: auto;}


This 'p' element contains an 'img' element with a class of 'test cl1', surrounded by 'span' elements with a class of 'bookend'. These elements are here: [bookend]image[bookend]. The image's width should be 30 pixels. The left and right padding, borders, and margins should all have zero width.

This 'p' element contains an 'img' element with a class of 'test cl2', surrounded by 'span' elements with a class of 'bookend'. These elements are here: [bookend]image[bookend]. The image's right and left padding should each be 10 pixels wide.

This 'p' element contains an 'img' element with a class of 'test cl3', surrounded by 'span' elements with a class of 'bookend'. These elements are here: [bookend]image[bookend]. The image's right and left borders should each be 10 pixels wide (and solid green).

This 'p' element contains an 'img' element with a class of 'test cl4', surrounded by 'span' elements with a class of 'bookend'. These elements are here: [bookend]image[bookend]. The image's right and left margins should each be 10 pixels wide.

This 'p' element contains an 'img' element with a class of 'test cl5', surrounded by 'span' elements with a class of 'bookend'. These elements are here: [bookend]image[bookend]. The image's right and left padding, border, and margins should each be 10 pixels wide, and the image's width should be 30 pixels.

This 'p' element contains an 'img' element with a class of 'test cl6', surrounded by 'span' elements with a class of 'bookend'. These elements are here: [bookend]image[bookend]. The image's width should be equal to its intrinsic width, which is 20 pixels.


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