CSS1 Test Suite: 5.4.4 vertical-align


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

The style declarations which apply to the text below are:

P {font-size: 12pt;}
.one {vertical-align: sub;}
.two {vertical-align: super;}
.three {vertical-align: top; font-size: 12pt;}
.four {vertical-align: text-top; font-size: 12pt;}
.five {vertical-align: middle; font-size: 12pt;}
.six {vertical-align: bottom; font-size: 12pt;}
.seven {vertical-align: text-bottom; font-size: 12pt;}
.eight {vertical-align: baseline; font-size: 12pt;}
.nine {vertical-align: 50%; font-size: 12px; line-height: 16px;}

P.example {font-size: 14pt;}
BIG {font-size: 16pt;}
SMALL {font-size: 12pt;}
.ttopalign {vertical-align: text-top;}
.topalign {vertical-align: top;}
.midalign {vertical-align: middle;}


[Image]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.

[Image]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.

[Image]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).

[Image] 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.

[Image] The image at the beginning of this sentence should be middle-aligned, which should align its middle with the point defined as the text baseline plus half the x-height.

[Image] The first four words in this sentence should be 12pt in size and bottom-aligned, which should align their bottom with the bottom of the lowest element in the line.

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

[Image] The first four words in this sentence should be 12pt in size and baseline-aligned, which should align their baseline with the baseline of the rest of the text in the line.

[Image]The first four words in this sentence should have a font-size of 12px and a line-height of 16px; they are also 50%-aligned, which should raise them 8px relative to the natural baseline.

In the following paragraph, all images should be aligned with the top of the 14-point 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).

This paragraph [Image] contains many images [Image] of varying heights [Image] and widths [Image] all of which [Image] should be aligned [Image] with the top of [Image] a 14-point text element [Image] regardless of the line in which [Image] the images appear. [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).

This paragraph [Image] contains many images [Image] of varying heights [Image] and widths [Image] all of which [Image] should be aligned [Image] with the middle of [Image] a 14-point text element [Image] regardless of the line in which [Image] the images appear. [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 SPANned appropriately in order to cause this to happen.

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

TABLE Testing Section
 

[Image]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.

[Image]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.

[Image]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).

[Image] 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.

[Image] The image at the beginning of this sentence should be middle-aligned, which should align its middle with the point defined as the text baseline plus half the x-height.

[Image] The first four words in this sentence should be 12pt in size and bottom-aligned, which should align their bottom with the bottom of the lowest element in the line.

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

[Image] The first four words in this sentence should be 12pt in size and baseline-aligned, which should align their baseline with the baseline of the rest of the text in the line.

[Image]The first four words in this sentence should have a font-size of 12px and a line-height of 16px; they are also 50%-aligned, which should raise them 8px relative to the natural baseline.

In the following paragraph, all images should be aligned with the top of the 14-point 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).

This paragraph [Image] contains many images [Image] of varying heights [Image] and widths [Image] all of which [Image] should be aligned [Image] with the top of [Image] a 14-point text element [Image] regardless of the line in which [Image] the images appear. [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).

This paragraph [Image] contains many images [Image] of varying heights [Image] and widths [Image] all of which [Image] should be aligned [Image] with the middle of [Image] a 14-point text element [Image] regardless of the line in which [Image] the images appear. [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 SPANned appropriately in order to cause this to happen.

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


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