Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I center top-to-bottom?

0 views
Skip to first unread message

Don Quixote

unread,
Mar 12, 2003, 12:24:37 AM3/12/03
to
Is there a way to center the contents of a <span> element top-to-bottom? I
know I can do text-align:center for horizontal, but I can't find its
equivalent for vertical alignment.


Thanks!

Rowland Shaw

unread,
Mar 12, 2003, 2:30:09 AM3/12/03
to
"Don Quixote" <donqui...@hotmail.removethis.com> wrote...

As a <span> is normally an in-line element, it would normally be line-height
tall; It's stil early in the morning, but iirc, you can align within the
line-height usining align.


Don Quixote

unread,
Mar 12, 2003, 6:34:08 AM3/12/03
to
"Rowland Shaw" <spamf...@anotherpointless.org> wrote in
news:#CnN4kG6...@TK2MSFTNGP11.phx.gbl:

Sorry, <span> was a poor example... however, there's no way to vertically
center multiple lines of text in, say, a <div> tag?

Ian Ward

unread,
Mar 12, 2003, 11:40:15 AM3/12/03
to
img, span and td are the only elements that support the vertical-align
property. there are a number of table-related elements that support it, but
only so far as to allow the tds to inherit the property. here are some
examples to try span and td vertical-alignment. fyi- td's default value is
middle.

<p>
line start <span style="height:200px; background-color:silver;
vertical-align:middle">aligned</span> line end
</p>

<table style="height:200px; background-color:silver">
<tr>
<td>text in a cell</td>
</tr>
</table>

- ian

"Don Quixote" <donqui...@hotmail.removethis.com> wrote in message
news:Xns933C38A6...@207.46.248.16...

0 new messages