1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
4 <TITLE>CSS1 Test Suite:
5.4.4 vertical-align
</TITLE>
5 <META http-equiv=
"Content-Type" content=
"text/html; charset=iso-8859-1">
6 <META http-equiv=
"Content-Style-Type" content=
"text/css">
8 <LINK rel=
"stylesheet" type=
"text/css" media=
"screen" href=
"../resources/base.css">
9 <STYLE type=
"text/css">
11 .one {vertical-align: sub;}
12 .two {vertical-align: super;}
13 .three {vertical-align: top; font-size:
12pt;}
14 .four {vertical-align: text-top; font-size:
12pt;}
15 .five {vertical-align: middle; font-size:
12pt;}
16 .six {vertical-align: bottom; font-size:
12pt;}
17 .seven {vertical-align: text-bottom; font-size:
12pt;}
18 .eight {vertical-align: baseline; font-size:
12pt;}
19 .nine {vertical-align:
50%; font-size:
12px; line-height:
16px;}
21 P.example {font-size:
14pt;}
22 BIG {font-size:
16pt;}
23 SMALL {font-size:
12pt;}
24 .ttopalign {vertical-align: text-top;}
25 .topalign {vertical-align: top;}
26 .midalign {vertical-align: middle;}
31 <BODY><P>The style declarations which apply to the text below are:
</P>
32 <PRE>P {font-size:
12pt;}
33 .one {vertical-align: sub;}
34 .two {vertical-align: super;}
35 .three {vertical-align: top; font-size:
12pt;}
36 .four {vertical-align: text-top; font-size:
12pt;}
37 .five {vertical-align: middle; font-size:
12pt;}
38 .six {vertical-align: bottom; font-size:
12pt;}
39 .seven {vertical-align: text-bottom; font-size:
12pt;}
40 .eight {vertical-align: baseline; font-size:
12pt;}
41 .nine {vertical-align:
50%; font-size:
12px; line-height:
16px;}
43 P.example {font-size:
14pt;}
44 BIG {font-size:
16pt;}
45 SMALL {font-size:
12pt;}
46 .ttopalign {vertical-align: text-top;}
47 .topalign {vertical-align: top;}
48 .midalign {vertical-align: middle;}
53 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50"><SPAN class=
"one">The first four words
</SPAN> in this sentence should be subscript-aligned. The font size of the superscripted text should not be different from that of the parent element.
56 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50"><SPAN class=
"two">The first four words
</SPAN> in this sentence should be superscript-aligned. The font size of the subscripted text should not be different from that of the parent element.
59 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50"><SPAN class=
"three">The first four words
</SPAN> 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).
62 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50">
63 <SPAN style=
"font-size: 200%;">
64 <SPAN class=
"four">The first four words
</SPAN> in this sentence should be text-top-aligned, which should align their tops with the top of the tallest text in the line.
68 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50" class=
"five">
69 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.
72 <IMG SRC=
"../resources/vblank.gif" align=
"top" alt=
"[Image]" height=
"50">
73 <SPAN style=
"font-size: 200%;">
74 <SPAN class=
"six">The first four words
</SPAN> 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.
78 <IMG SRC=
"../resources/vblank.gif" align=
"top" alt=
"[Image]" height=
"50">
79 <SPAN style=
"font-size: 200%;">
80 <SPAN class=
"seven">The first eight words (
"eight" has a descender)
</SPAN> 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.
84 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50">
85 <SPAN style=
"font-size: 200%;">
86 <SPAN class=
"eight">The first four words
</SPAN> 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.
90 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50"><SPAN class=
"nine">The first four words
</SPAN> 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.
93 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).
97 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"30" class=
"ttopalign">
98 <SPAN style=
"font-size: 250%;">contains many images
</SPAN>
99 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50" class=
"ttopalign">
100 <BIG>of varying heights
</BIG>
101 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"10" class=
"ttopalign">
102 <SMALL>and widths
</SMALL>
103 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"20" class=
"ttopalign">
105 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"65" class=
"ttopalign">
106 <SPAN style=
"font-size: 2em;">should be aligned
</SPAN>
107 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"35" class=
"ttopalign">
109 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"30" class=
"ttopalign">
110 <SPAN style=
"font-size: 150%;">a
<SPAN style=
"font-size: 250%;">14-point
</SPAN> text element
</SPAN>
111 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50" class=
"ttopalign">
112 <SMALL>regardless of the line in which
</SMALL>
113 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"15" class=
"ttopalign">
114 <BIG>the images appear.
</BIG>
115 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"90" class=
"ttopalign">
118 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).
122 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"30" class=
"midalign">
123 <SPAN style=
"font-size: 250%;">contains many images
</SPAN>
124 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50" class=
"midalign">
126 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"10" class=
"midalign">
127 <SMALL>and widths
</SMALL>
128 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"20" class=
"midalign">
130 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"65" class=
"midalign">
132 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"35" class=
"midalign">
133 <SPAN style=
"font-size: 2em;">with the middle of
</SPAN>
134 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50" class=
"midalign">
135 <SPAN style=
"font-size: 150%;">a
<SPAN style=
"font-size: 250%;">14-point
</SPAN> text element
</SPAN>
136 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50" class=
"midalign">
137 <SMALL>regardless of the line in which
</SMALL>
138 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"15" class=
"midalign">
139 <BIG>the images appear.
</BIG>
140 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"90" class=
"midalign">
143 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.
146 <SPAN class=
"topalign">This paragraph
</SPAN>
147 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"10" class=
"topalign">
148 <SPAN style=
"font-size: 250%;" class=
"topalign">contains many images
</SPAN>
149 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"10" class=
"topalign">
150 <SPAN class=
"topalign">and some text
</SPAN>
151 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"10" class=
"topalign">
152 <SPAN class=
"topalign">of varying heights
</SPAN>
153 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"10" class=
"topalign">
154 <BIG class=
"topalign">and widths
</BIG>
155 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"20" class=
"topalign">
156 <SPAN class=
"topalign">all of which
</SPAN>
157 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"65" class=
"topalign">
158 <SPAN class=
"topalign">should be aligned
</SPAN>
159 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"35" class=
"topalign">
160 <SPAN style=
"font-size: 2em;" class=
"topalign">with the top of
</SPAN>
161 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50" class=
"topalign">
162 <SPAN class=
"topalign">the tallest element in
</SPAN>
163 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"15" class=
"topalign">
164 <BIG class=
"topalign">whichever line the elements appear.
</BIG>
165 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"90" class=
"topalign">
169 <TABLE border
cellspacing=
"0" cellpadding=
"3" class=
"tabletest">
171 <TD colspan=
"2" bgcolor=
"silver"><STRONG>TABLE Testing Section
</STRONG></TD>
174 <TD bgcolor=
"silver"> </TD>
176 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50"><SPAN class=
"one">The first four words
</SPAN> in this sentence should be subscript-aligned. The font size of the superscripted text should not be different from that of the parent element.
179 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50"><SPAN class=
"two">The first four words
</SPAN> in this sentence should be superscript-aligned. The font size of the subscripted text should not be different from that of the parent element.
182 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50"><SPAN class=
"three">The first four words
</SPAN> 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).
185 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50">
186 <SPAN style=
"font-size: 200%;">
187 <SPAN class=
"four">The first four words
</SPAN> in this sentence should be text-top-aligned, which should align their tops with the top of the tallest text in the line.
191 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50" class=
"five">
192 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.
195 <IMG SRC=
"../resources/vblank.gif" align=
"top" alt=
"[Image]" height=
"50">
196 <SPAN style=
"font-size: 200%;">
197 <SPAN class=
"six">The first four words
</SPAN> 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.
201 <IMG SRC=
"../resources/vblank.gif" align=
"top" alt=
"[Image]" height=
"50">
202 <SPAN style=
"font-size: 200%;">
203 <SPAN class=
"seven">The first eight words (
"eight" has a descender)
</SPAN> 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.
207 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50">
208 <SPAN style=
"font-size: 200%;">
209 <SPAN class=
"eight">The first four words
</SPAN> 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.
213 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50"><SPAN class=
"nine">The first four words
</SPAN> 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.
216 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).
220 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"30" class=
"ttopalign">
221 <SPAN style=
"font-size: 250%;">contains many images
</SPAN>
222 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50" class=
"ttopalign">
223 <BIG>of varying heights
</BIG>
224 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"10" class=
"ttopalign">
225 <SMALL>and widths
</SMALL>
226 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"20" class=
"ttopalign">
228 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"65" class=
"ttopalign">
229 <SPAN style=
"font-size: 2em;">should be aligned
</SPAN>
230 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"35" class=
"ttopalign">
232 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"30" class=
"ttopalign">
233 <SPAN style=
"font-size: 150%;">a
<SPAN style=
"font-size: 250%;">14-point
</SPAN> text element
</SPAN>
234 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50" class=
"ttopalign">
235 <SMALL>regardless of the line in which
</SMALL>
236 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"15" class=
"ttopalign">
237 <BIG>the images appear.
</BIG>
238 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"90" class=
"ttopalign">
241 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).
245 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"30" class=
"midalign">
246 <SPAN style=
"font-size: 250%;">contains many images
</SPAN>
247 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50" class=
"midalign">
249 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"10" class=
"midalign">
250 <SMALL>and widths
</SMALL>
251 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"20" class=
"midalign">
253 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"65" class=
"midalign">
255 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"35" class=
"midalign">
256 <SPAN style=
"font-size: 2em;">with the middle of
</SPAN>
257 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50" class=
"midalign">
258 <SPAN style=
"font-size: 150%;">a
<SPAN style=
"font-size: 250%;">14-point
</SPAN> text element
</SPAN>
259 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50" class=
"midalign">
260 <SMALL>regardless of the line in which
</SMALL>
261 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"15" class=
"midalign">
262 <BIG>the images appear.
</BIG>
263 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"90" class=
"midalign">
266 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.
269 <SPAN class=
"topalign">This paragraph
</SPAN>
270 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"10" class=
"topalign">
271 <SPAN style=
"font-size: 250%;" class=
"topalign">contains many images
</SPAN>
272 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"10" class=
"topalign">
273 <SPAN class=
"topalign">and some text
</SPAN>
274 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"10" class=
"topalign">
275 <SPAN class=
"topalign">of varying heights
</SPAN>
276 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"10" class=
"topalign">
277 <BIG class=
"topalign">and widths
</BIG>
278 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"20" class=
"topalign">
279 <SPAN class=
"topalign">all of which
</SPAN>
280 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"65" class=
"topalign">
281 <SPAN class=
"topalign">should be aligned
</SPAN>
282 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"35" class=
"topalign">
283 <SPAN style=
"font-size: 2em;" class=
"topalign">with the top of
</SPAN>
284 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"50" class=
"topalign">
285 <SPAN class=
"topalign">the tallest element in
</SPAN>
286 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"15" class=
"topalign">
287 <BIG class=
"topalign">whichever line the elements appear.
</BIG>
288 <IMG SRC=
"../resources/vblank.gif" alt=
"[Image]" height=
"90" class=
"topalign">
290 </TD></TR></TABLE></BODY>