...

View Full Version : vertical align?



alykins
07-17-2011, 05:11 PM
So i usually never have a need for this; but i got bored today and decided to "play around" with an alternative i have read about to vertically align a div (note i usually do via other means)... first the code


<html>
<head>
<title>Starbuzz Coffee</title>
<style type="text/css">
#one{
width:100%;
height:50px;
background:blue;
}
#main{
display:table-cell;
vertical-align:middle;
width:300px;
height:200px;
background:orange;
border:1px solid black;
}
</style>
</head>


<body>

<div id="main">
<div id="one">text to be centered
</div>
</div>

</body>
</html>

so the only issue i have is with IE... FF and chrome both apply the "trick" but IE(9) completely ignores it. has anyone fiddled with this and know why it is not working? or an "hack" to make IE recognize?
Again not really "high priority" i just got bored/distracted this morning. Also please no spams of things like
"don't use IE" or
"force users to use something other than IE" or
well, you get the point.

Sammy12
07-17-2011, 09:24 PM
I never use vertical-align :)

hopefully this bump will help get an answer
I know it could be very handy esp. when you want something vertically centered.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum