This is an example of how one would center something Vertically inside a division

This is the outer DIV
This is text in the inner DIV

This is the source of the above example:

<html>
<head>
<script>
function foo() {
     document.all.one.style.top = 50; //Bug. Inner DIV will not re-render without forcing outer DIV to rerender.
     document.all.two.style.top = document.all.one.offsetHeight/2 - document.all.two.offsetHeight/2;
     document.all.two.style.left = document.all.one.offsetWidth/2 - document.all.two.offsetWidth/2;
}
window.onload=foo;
</script>
</head>

<body>
text in beginning<br>

<div id=one style="position:absolute; top:10; height:200;width:200;background-color:green">
     text in the outer DIV
     <div id=two style="position:absolute;left:50;width:100;color:red; border:red 2px solid">
          text in the inner DIV
     </div>
</div>

</body>
</html>