Forum Moderators: not2easy

Message Too Old, No Replies

the vertical-align attribute? Why cant i get it to function.

vertical-align?

         

Matthew1980

11:17 am on May 13, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi there Webmaster world!

When i nest a div within a div within a div (one inside the other), why will the vertical-align attribute not function. Im fed up of using <br> tags to get the text centered. Or is it something reserved for img or p tags?

Thanks for the help.

Matthew

simonuk

12:20 pm on May 13, 2009 (gmt 0)

10+ Year Member



There is very limited support in browsers for vertical alignment so you will either need to use JS or some nasty hackery to pull it off.

CSS_Kidd

1:49 pm on May 13, 2009 (gmt 0)

10+ Year Member



Here is a simple little trick I do. I just use even top and bottom padding to vertically align content in a div.

Matthew1980

3:21 pm on May 13, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Guys,

Thanks for the tips; looked over a few hack pages on google search, but i thought there would be something like you would have in tables, but obviously not.

Top and bottom padding it is then!

Cheers,

Matthew