View Single Post
Old 07-16-2004, 08:59 AM   #2 (permalink)
SinisterMotives
Junkie
 
What browser are you using? The vertical-align property generally works in Internet Explorer but not in Mozilla, as near as I can tell.

If all else fails, you could use a JavaScript to move the DIV to the center of the page:

PHP Code:
<html>
 <
head>
  <
script type="text/javascript">
   function 
centerText() {
    
document.getElementById('centeredText').style.left = (document.body.clientWidth 2) - (parseInt(document.getElementById('centeredText').style.width) / 2) + "px";
    
document.getElementById('centeredText').style.top = (document.body.clientHeight 2) - (parseInt(document.getElementById('centeredText').style.height) / 2) + "px";
   }
  
</script>
 </head>
 <body onload="centerText()">
  <div id="centeredText" style="width: 400px; height: 300px;">Centered Text</div>
 </body>
</html> 
You'll need to adjust the width and height of the DIV to match the dimensions of the text as closely as possible to get it perfectly centered.

[Chandler]Could the posting textarea be any smaller on this site?[/Chandler]
SinisterMotives is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60