Hmmm, that's strange. I'm not exactly sure how that happened! My original example file here doesn't even match the one in the book.
Anyway, there is a breif explanation of the text-top and text-bottom properties on page 338.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title></title>
<style type='text/css'>
p {
margin: 10px;
font-size: 40px;
}
span {
background: lightblue;
}
span.valign {
font-size: 16px;
color: white;
background: steelblue;
font-weight: bold;
}
span#baseline {
vertical-align: baseline;
}
span#top {
vertical-align: top;
}
span#text-top {
vertical-align: text-top;
}
span#middle {
vertical-align: middle;
}
span#text-bottom {
vertical-align: text-bottom;
}
span#bottom {
vertical-align: bottom;
}
</style>
</head>
<body>
<p>
<span>
Peter Piper picked a peck of
<span class='valign' id='baseline'>pickled</span>
peppers.
</span>
</p>
<p>
<span>
Did Peter Piper pick a peck of
<span class='valign' id='top'>pickled</span>
peppers?
</span>
</p>
<p>
<span>
Did Peter Piper pick a peck of
<span class='valign' id='text-top'>pickled</span>
peppers?
</span>
</p>
<p>
<span>
If Peter Piper picked a peck of
<span class='valign' id='middle'>pickled</span>
peppers,
</span>
</p>
<p>
<span>
where's the peck of
<span class='valign' id='text-bottom'>pickled</span>
peppers Peter Piper picked?
</span>
</p>
<p>
<span>
where's the peck of
<span class='valign' id='bottom'>pickled</span>
peppers Peter Piper picked?
</span>
</p>
</body>
</html>
The difference between text-top and top and text-bottom and bottom is really subtle on screen. Whereas top is align to the top of the line box, text-top is align with the top of the tallest character on the line, whichever that may be. text-bottom, similarly is aligned with the lowest character.
In IE, it looks to me that they've just made text-top do what top does, and text-bottom do what bottom does. Firefox looks like it actually follows the align with tallest/lowest letter algorithm in the specifications.
Regards,
Rich
--
[
http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design