Another question- centre on page

windows

Guest
I know you use align="centre" to put something in the centre of a page horosontally... but is there a tag which would de that vertically. <br />
<br />
At the moment I resort to <p>&nbsp;</p>'s but that means different res's have divverent views etc.<br />
<br />
Awe.<!--content-->You can't do it with markup tagging. You need a little styling and<br />
scripting, like this:<br />
<br />
<HTML><br />
<HEAD><br />
<title> centered background </title><br />
<STYLE TYPE="text/css"><br />
#bgID { position:absolute;top:1;left:1}<br />
</STYLE><br />
<script language="JavaScript"><br />
<!--<br />
function initBG()<br />
{<br />
var W= window.screen.width;<br />
var H= window.screen.height;<br />
var IE = (document.all) ? true : false;<br />
var NS4 = (document.layers) ? true : false;<br />
var NS6 = (document.getElementById && !document.all) ? true : false;<br />
if (IE)<br />
{<br />
document.all["bgID"].style.top=(H - document.all["bgID"].clientHeight)/2;<br />
document.all["bgID"].style.left=(W - document.all["bgID"].clientWidth)/2;<br />
}<br />
else<br />
{<br />
if (NS4)<br />
{<br />
document.layers["bgID"].top=(H - document.layers["bgID"].document.height)/2;<br />
document.layers["bgID"].left=(H - document.layers["bgID"].document.width)/2;<br />
}<br />
else<br />
{<br />
document.getElementById("bgID").style.top=(H - document.getElementById("bgID").offsetHeight)/2;<br />
document.getElementById("bgID").style.left=(W - document.getElementById ("bgID").offsetWidth)/2;<br />
}<br />
}<br />
}<br />
//--><br />
</script><br />
</HEAD><br />
<BODY onLoad="initBG()"><br />
<DIV ID="bgID"><br />
Whatever you want centered<br />
</DIV><br />
</BODY> <br />
</HTML><!--content-->theres also absolute positioning:<br />
<br />
<span style="position: relative; top:70px;left:50px">Tsdfsd</span><br />
<br />
<br />
fool around with with top: and left:<br />
<br />
left: can also be right, and bottom.<!--content-->
 
Back
Top