rocky14547
Programmer
- Apr 8, 2008
- 8
How does one...
1-Center a DIV horizontally in a window of any size
2-but give a position:absolute for the vertical from top
I'm trying to get the button centered on any size page but I don't know how to push the button up or down. What tells it what vertical position to take right now? Seems like nothing.
---------
<html>
<head>
<style>
#rule1bkg {background-image: url(header-corner.gif); background-repeat: repeat-x; height:100px;}
</style>
<style>
#rule1txt {position:absolute;left:30px;top:30px; font-size: x-large; color:white;
font-family:helvetica, impact, sans-serif;}
</style>
<style>
#button {text-align:center;}
</style>
</head>
<body>
<div id="rule1bkg"></div>
<div id="rule1txt">Reverse-Phone Directory</div>
<div id="button"><a href="<img src="buttonUP.jpg" height="30"></a></div>
</body>
</html>
-----------
Thanks guys
1-Center a DIV horizontally in a window of any size
2-but give a position:absolute for the vertical from top
I'm trying to get the button centered on any size page but I don't know how to push the button up or down. What tells it what vertical position to take right now? Seems like nothing.
---------
<html>
<head>
<style>
#rule1bkg {background-image: url(header-corner.gif); background-repeat: repeat-x; height:100px;}
</style>
<style>
#rule1txt {position:absolute;left:30px;top:30px; font-size: x-large; color:white;
font-family:helvetica, impact, sans-serif;}
</style>
<style>
#button {text-align:center;}
</style>
</head>
<body>
<div id="rule1bkg"></div>
<div id="rule1txt">Reverse-Phone Directory</div>
<div id="button"><a href="<img src="buttonUP.jpg" height="30"></a></div>
</body>
</html>
-----------
Thanks guys