OK, we've had this before, but here we go again. Show me an example of centering a div vertically and horizontally on the screen, where you don't need to know ANY sizes beforehand, don't need negative margins, AND the result works in the viewport even when the viewport is smaller than the content. (i.e., you can get to the top of it, and scroll) AND it's got to work in IE.

Answer:

<style type="text/css">
<!--
body, html {
   height     : 100%;
}
#layoutgrid{
   height     : 100%;
   width     : 100%;
}
#layoutgrid td {
   vertical-align : middle;
   text-align     : center;
}
-->
</style>
</head>

<body>
<table id="layoutgrid">
 <tr>
   <td >
    This text is in the middle!
   </td>
 </tr>
</table>
</body>

One simple table!  Now do it without a table . . .



Christian Montoya wrote:

Please send us all an example of a site where this was necessary.

As usual designers want "bells and whistles" without any necessity.
When I find a reason to actually use equal height columns, I'll let
you all know.

--
--
Christian Montoya

--
Best Regards,

Bob McClelland

Cornwall (UK)
www.gwelanmor-internet.co.uk


******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************

Reply via email to