CSS2 Test Suite: 10.8 vertical-align

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

The style declarations contained within this page:

p {font-size: 15px;}
p img {height: 50px; width: 15px;}
.cl1 {vertical-align: sub;}
.cl2 {vertical-align: super;}
.cl3 {vertical-align: top; font-size: 15px;}
.cl4 {vertical-align: text-top; font-size: 15px;}
.cl5 {vertical-align: middle; font-size: 15px;}
.cl6 {vertical-align: bottom; font-size: 15px;}
.cl7 {vertical-align: text-bottom; font-size: 15px;}
.cl8 {vertical-align: baseline; font-size: 15px;}
.cl9 {vertical-align: 50%; font-size: 15px; line-height: 20px;}
p.explain {margin-top: 2em; padding-top: 0.5em; border-top: 2px groove silver;}
p.ttopalign img, span.ttopalign {vertical-align: text-top;}
p.topalign img, span.topalign {vertical-align: top;}
p.midalign img, span.midalign {vertical-align: middle;}
big {font-size: 20px;}
small {font-size: 15px;}
img.px10 {height: 10px;}
img.px15 {height: 15px;}
img.px20 {height: 20px;}
img.px35 {height: 35px;}
img.px50 {height: 50px;}
img.px65 {height: 65px;}
img.px90 {height: 90px;}


test image[cl1] The first four words in this sentence should be subscript-aligned. The font size of the superscripted text should not be different from that of the parent element.

test image[cl2] The first four words in this sentence should be superscript-aligned. The font size of the subscripted text should not be different from that of the parent element.

test image[cl3] The first four words in this sentence should be top-aligned, which will align their tops with the top of the tallest element in the line (probably the orange rectangle).

test image [cl4] The first four words in this sentence should be text-top-aligned, which should align their tops with the top of the tallest text in the line.

test image [cl6] The first four words in this sentence should be 15px in size and bottom-aligned, which should align their bottom with the bottom of the lowest element in the line.

test image [cl7] The first eight words ("eight" has a descender) in this sentence should be 15px in size and text-bottom-aligned, which should align their bottom with the bottom of the lowest text (including descenders) in the line.

test image [cl8] The first four words in this sentence should be 15px in size and baseline-aligned, which should align their baseline with the baseline of the rest of the text in the line.

test image[cl9] The first four words in this sentence should have a font-size of 15px and a line-height of 20px; they are also 50%-aligned, which should raise them 10px relative to the natural baseline.

In the following paragraph, all images should be aligned with the top of the 15-pixel text, which is identical to the first section of text, whereas any size text should be aligned with the text baseline (which is the default value).

[ttopalign] This paragraph test image contains many images test image of varying heights test image and widths test image all of which test image should be aligned test image with the top of test image a 15-pixel text element test image regardless of the line in which test image the images appear. test image

In the following paragraph, all images should be aligned with the middle of the default text, whereas any text should be aligned with the text baseline (which is the default value).

[midalign] This paragraph test image contains many images test image of varying heights test image and widths test image all of which test image should be aligned test image with the middle of test image a 15-pixel text element test image regardless of the line in which test image the images appear. test image

In the following paragraph, all elements should be aligned with the top of the tallest element on the line, whether that element is an image or not. Each fragment of text has been 'span'ned appropriately in order to cause this to happen.

[topalign] This paragraph test image contains many images test image and some text test image of varying heights test image and widths test image all of which test image should be aligned test image with the top of test image the tallest element in test image whichever line the elements appear. test image


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