vertical-align

J

Jeff Thies

You can do this in a table cell:
....
<td valign="middle">
<p>content in middle of cell</p>
</td>

Can you do this with a div?

<div style="height: 300px; vertical-align: middle">

<p>...

Actually, I read that that should work! Does nothing for me.

Jeff
 
R

rf

Jeff Thies said:
You can do this in a table cell:
...
<td valign="middle">
<p>content in middle of cell</p>
</td>

http://www.w3.org/TR/html4/struct/tables.html#h-11.2.6

Yep. valign is specifically mentioned for table cell elements.
Can you do this with a div?

<div style="height: 300px; vertical-align: middle">

<p>...

http://www.w3.org/TR/html4/struct/global.html#h-7.5.4

Nope. valign is not mentioned for div elements.
Actually, I read that that should work!

Where did you read that?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top