View Full Version : Vertical Alignment in DIV Layer
29th September 06, 09:23 AM
How can I vertically align text in a div layer?
29th September 06, 10:26 AM
Step 3 — Multiple lines vertical-align:middle
This must be the trickiest part of the vertical-align functionality to be achieved with CSS. If we were to just use the trick from Step2 and set the absolutely aligned div to top:50% or bottom:50%, this would align the top part of the text (or its baseline) at the middle — so its not really middle vertically aligned. We could use the actual vertical-align property but it only works for inline elements, so we should use display:table and display:table-cell for the enclosing divs.
29th September 06, 12:44 PM
Thanks, but it only seems to work in FF, has no affect in IE, plus I have lets say 4 divs below each other when I apply display: table-cell it arranges my divs horizontally. Is there any way to control the orientation? I also tried the same method with a UL, but get the same behaviour.
29th September 06, 04:59 PM
I never use that because it does not support IE. So try position: static; ? Or either search vertical align in google.
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.