1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>CSS1 Test Suite: 5.4.4 vertical-align</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META http-equiv="Content-Style-Type" content="text/css">
<STYLE type="text/css">
p {font-size: 12pt; border: 1px dotted orange;}
.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;}
</STYLE>
</HEAD>
<BODY><P>The style declarations which apply to the text below are:</P>
<PRE>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;}
</PRE>
<HR>
<P>
<IMG SRC="images/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.
</P>
<P>
<IMG SRC="images/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.
</P>
<P>
<IMG SRC="images/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).
</P>
<P>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50">
<SPAN style="font-size: 200%;">
<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.
</SPAN>
</P>
<P>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50" class="five">
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.
</P>
<P>
<IMG SRC="images/vblank.gif" align="top" alt="[Image]" height="50">
<SPAN style="font-size: 200%;">
<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.
</SPAN>
</P>
<P>
<IMG SRC="images/vblank.gif" align="top" alt="[Image]" height="50">
<SPAN style="font-size: 200%;">
<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.
</SPAN>
</P>
<P>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50">
<SPAN style="font-size: 200%;">
<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.
</SPAN>
</P>
<P>
<IMG SRC="images/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.
</P>
<P>
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).
</P>
<P class="example">
This paragraph
<IMG SRC="images/vblank.gif" alt="[Image]" height="30" class="ttopalign">
<SPAN style="font-size: 250%;">contains many images</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50" class="ttopalign">
<BIG>of varying heights</BIG>
<IMG SRC="images/vblank.gif" alt="[Image]" height="10" class="ttopalign">
<SMALL>and widths</SMALL>
<IMG SRC="images/vblank.gif" alt="[Image]" height="20" class="ttopalign">
all of which
<IMG SRC="images/vblank.gif" alt="[Image]" height="65" class="ttopalign">
<SPAN style="font-size: 2em;">should be aligned</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="35" class="ttopalign">
with the top of
<IMG SRC="images/vblank.gif" alt="[Image]" height="30" class="ttopalign">
<SPAN style="font-size: 150%;">a <SPAN style="font-size: 250%;">14-point</SPAN> text element</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50" class="ttopalign">
<SMALL>regardless of the line in which</SMALL>
<IMG SRC="images/vblank.gif" alt="[Image]" height="15" class="ttopalign">
<BIG>the images appear.</BIG>
<IMG SRC="images/vblank.gif" alt="[Image]" height="90" class="ttopalign">
</P>
<P class="explain">
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).
</P>
<P>
This paragraph
<IMG SRC="images/vblank.gif" alt="[Image]" height="30" class="midalign">
<SPAN style="font-size: 250%;">contains many images</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50" class="midalign">
of varying heights
<IMG SRC="images/vblank.gif" alt="[Image]" height="10" class="midalign">
<SMALL>and widths</SMALL>
<IMG SRC="images/vblank.gif" alt="[Image]" height="20" class="midalign">
all of which
<IMG SRC="images/vblank.gif" alt="[Image]" height="65" class="midalign">
should be aligned
<IMG SRC="images/vblank.gif" alt="[Image]" height="35" class="midalign">
<SPAN style="font-size: 2em;">with the middle of</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50" class="midalign">
<SPAN style="font-size: 150%;">a <SPAN style="font-size: 250%;">14-point</SPAN> text element</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50" class="midalign">
<SMALL>regardless of the line in which</SMALL>
<IMG SRC="images/vblank.gif" alt="[Image]" height="15" class="midalign">
<BIG>the images appear.</BIG>
<IMG SRC="images/vblank.gif" alt="[Image]" height="90" class="midalign">
</P>
<P class="explain">
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.
</P>
<P>
<SPAN class="topalign">This paragraph</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="10" class="topalign">
<SPAN style="font-size: 250%;" class="topalign">contains many images</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="10" class="topalign">
<SPAN class="topalign">and some text</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="10" class="topalign">
<SPAN class="topalign">of varying heights</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="10" class="topalign">
<BIG class="topalign">and widths</BIG>
<IMG SRC="images/vblank.gif" alt="[Image]" height="20" class="topalign">
<SPAN class="topalign">all of which</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="65" class="topalign">
<SPAN class="topalign">should be aligned</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="35" class="topalign">
<SPAN style="font-size: 2em;" class="topalign">with the top of</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50" class="topalign">
<SPAN class="topalign">the tallest element in</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="15" class="topalign">
<BIG class="topalign">whichever line the elements appear.</BIG>
<IMG SRC="images/vblank.gif" alt="[Image]" height="90" class="topalign">
</P>
<STRONG>TABLE Testing Section</STRONG>
<P>
<IMG SRC="images/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.
</P>
<P>
<IMG SRC="images/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.
</P>
<P>
<IMG SRC="images/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).
</P>
<P>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50">
<SPAN style="font-size: 200%;">
<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.
</SPAN>
</P>
<P>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50" class="five">
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.
</P>
<P>
<IMG SRC="images/vblank.gif" align="top" alt="[Image]" height="50">
<SPAN style="font-size: 200%;">
<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.
</SPAN>
</P>
<P>
<IMG SRC="images/vblank.gif" align="top" alt="[Image]" height="50">
<SPAN style="font-size: 200%;">
<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.
</SPAN>
</P>
<P>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50">
<SPAN style="font-size: 200%;">
<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.
</SPAN>
</P>
<P>
<IMG SRC="images/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.
</P>
<P>
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).
</P>
<P class="example">
This paragraph
<IMG SRC="images/vblank.gif" alt="[Image]" height="30" class="ttopalign">
<SPAN style="font-size: 250%;">contains many images</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50" class="ttopalign">
<BIG>of varying heights</BIG>
<IMG SRC="images/vblank.gif" alt="[Image]" height="10" class="ttopalign">
<SMALL>and widths</SMALL>
<IMG SRC="images/vblank.gif" alt="[Image]" height="20" class="ttopalign">
all of which
<IMG SRC="images/vblank.gif" alt="[Image]" height="65" class="ttopalign">
<SPAN style="font-size: 2em;">should be aligned</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="35" class="ttopalign">
with the top of
<IMG SRC="images/vblank.gif" alt="[Image]" height="30" class="ttopalign">
<SPAN style="font-size: 150%;">a <SPAN style="font-size: 250%;">14-point</SPAN> text element</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50" class="ttopalign">
<SMALL>regardless of the line in which</SMALL>
<IMG SRC="images/vblank.gif" alt="[Image]" height="15" class="ttopalign">
<BIG>the images appear.</BIG>
<IMG SRC="images/vblank.gif" alt="[Image]" height="90" class="ttopalign">
</P>
<P class="explain">
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).
</P>
<P>
This paragraph
<IMG SRC="images/vblank.gif" alt="[Image]" height="30" class="midalign">
<SPAN style="font-size: 250%;">contains many images</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50" class="midalign">
of varying heights
<IMG SRC="images/vblank.gif" alt="[Image]" height="10" class="midalign">
<SMALL>and widths</SMALL>
<IMG SRC="images/vblank.gif" alt="[Image]" height="20" class="midalign">
all of which
<IMG SRC="images/vblank.gif" alt="[Image]" height="65" class="midalign">
should be aligned
<IMG SRC="images/vblank.gif" alt="[Image]" height="35" class="midalign">
<SPAN style="font-size: 2em;">with the middle of</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50" class="midalign">
<SPAN style="font-size: 150%;">a <SPAN style="font-size: 250%;">14-point</SPAN> text element</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50" class="midalign">
<SMALL>regardless of the line in which</SMALL>
<IMG SRC="images/vblank.gif" alt="[Image]" height="15" class="midalign">
<BIG>the images appear.</BIG>
<IMG SRC="images/vblank.gif" alt="[Image]" height="90" class="midalign">
</P>
<P class="explain">
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.
</P>
<P>
<SPAN class="topalign">This paragraph</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="10" class="topalign">
<SPAN style="font-size: 250%;" class="topalign">contains many images</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="10" class="topalign">
<SPAN class="topalign">and some text</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="10" class="topalign">
<SPAN class="topalign">of varying heights</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="10" class="topalign">
<BIG class="topalign">and widths</BIG>
<IMG SRC="images/vblank.gif" alt="[Image]" height="20" class="topalign">
<SPAN class="topalign">all of which</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="65" class="topalign">
<SPAN class="topalign">should be aligned</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="35" class="topalign">
<SPAN style="font-size: 2em;" class="topalign">with the top of</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="50" class="topalign">
<SPAN class="topalign">the tallest element in</SPAN>
<IMG SRC="images/vblank.gif" alt="[Image]" height="15" class="topalign">
<BIG class="topalign">whichever line the elements appear.</BIG>
<IMG SRC="images/vblank.gif" alt="[Image]" height="90" class="topalign">
</P>
</BODY>
</HTML>
|