I am trying to create a table in which each cell contains a large floating h1 on the left side and more small text to the right of the large text with a vertical orientation.
However, small text is displayed at the top of each cell, even though it has a vertical alignment: medium ad. When I delete a large floating element, everything looks great. I tested it in the latest versions of IE, Firefox, and Safari, and this happened in every case.
Why is this happening? Does anyone know about this? Here is an example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html><head> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'> <title>vertical-align test</title> <style type="text/css"> td { border: solid black 1px; vertical-align: middle; font-size: 12px} h1 { font-size: 40px; float: left} </style> </head> <body> <table> <tr> <td><h1>1</h1>The quick brown fox jumps over the lazy dog.</td> <td>The quick brown fox jumps over the lazy dog.</td> </tr> </table> </body></html>
Note that the small text in the first cell is at the top for some reason, but the text in the 2nd cell is vertically centered.
source share