W3C home > Mailing lists > Public > www-style@w3.org > February 2003

Re: No vertical-align of anchor with height larger than it's inner text

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Sat, 15 Feb 2003 14:47:18 -0500
Message-Id: <200302151947.OAA12927@nerd-xing.mit.edu>
To: Gustav Svensson <gurra16@spray.se>
cc: www-style@w3.org

> <table border=3D"1">
> <tbody>
>   <tr>
>     <td style=3D"height: 4em;">
>       <a href=3D"#" style=3D"background-color: red; display: block; height: 1
> 00%;">LINK</a>
>     </td>
>   </tr>
> </tbody>
> <table>

How about:

<a href="whatever" style="display: table-cell; vertical-align: middle"> LINK </a>

instead of using HTML tables to try to achieve a pure layout effect?

> Or rather in the vertical middle of the anchor's vertical span.

There is no way to do this for a display:block box, correct.

Boris
-- 
"Why can one call the time component of the preceding 4-vector 
by the name energy?  For two reasons:  First, because this time 
component has the correct units -- the units of mass..."
             -- From "Spacetime Physics" by Taylor and Wheeler
Received on Saturday, 15 February 2003 14:47:20 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:19 GMT