cmw000
01-10-2006, 10:09 AM
I'm trying to make it so that all my divs stay centered properly when the window 's width is resized. Even though they're all set to relative, two of them appear to be fixed in space and do not move when the window is resized. Any help would be appreciated.:thumbsup:
<html><head>
<title>Alliance Border Patrol</title>
<link rel="stylesheet" type="text/css" href="index.css" media="screen">
<script type="text/javascript">
//<![CDATA[
function doStuff(el) {
var links=document.getElementsByTagName("a");
for(i=0;i<links.length;i++) {
if(links[i].className=="white") {
links[i].style.color="#cccccc";
}
}
el.style.color="#ffcc66";
}
//]]>
</script>
</head><body style="background:#000">
<script type="text/javascript">
<!--
function show_me(id){
document.getElementById("box2").innerHTML=document.getElementById(id).innerHTML
}
//-->
</script>
<div id="top">
<a href="index.html"><img src="img/your_mom.gif" alt="Alliance Border Patrol"></a>
</div>
<div id="left" class="data">
<br>
<a class="white" href="news.html" target="theframe" onclick="doStuff(this)" onfocus="this.blur()">NEWS    </a>
<br><br><br><br>
<a class="white" href="info.html" target="theframe" onclick="doStuff(this)" onfocus="this.blur()">INFO    </a>
<br><br><br><br>
<a class="white" href="rules.html" target="theframe" onclick="doStuff(this)" onfocus="this.blur()">RULES    </a>
<br><br><br><br>
<a class="white" href="roster.html" target="theframe" onclick="doStuff(this)" onfocus="this.blur()">ROSTER    </a>
<br><br><br><br>
<a class="white" href="gbank.html" target="theframe" onclick="doStuff(this)" onfocus="this.blur()">GBANK    </a>
<br><br><br><br>
<a class="white" href="pics.html" target="theframe" onclick="doStuff(this)" onfocus="this.blur()">PICS     </a>
</div>
<div id="right">
<iframe class="mframes" src="news.html" name="theframe" scrolling="auto" frameborder="0" marginwidth="15px" marginheight="0px" allowtransparency="true"></iframe>
</div>
<div id="bottom">
</div>
</body></html>
body{ text-align:center; position:relative; background-color: transparent; }
*{ text-decoration:none; margin:0; padding:0; }
img { border:0; }
#top { position:relative; top: 30px; }
#left { position:relative; font:small-caps 900 12px arial; float:left; text-align:right; top:80px; left:150px; }
#right { position: relative; background-image: url(img/border.gif); background-repeat:no-repeat; height: 500px; width:600px; top:40px; left: 250px; }
iframe { position: relative; top:35px; left:-31px; scrolling:auto; width:536px; height: 430px; //left:0px;}
.data { color: #cccccc; text-align:left; font:small-caps 900 18px arial;}
.data a:link { color:#cccccc; }
.data a:visited { color:#cccccc; }
.ext { color: #cccccc; text-align:left; font:small-caps 900 18px arial; }
.ext a:link { color:#ffcc66; }
.ext a:visited { color:#ffcc66; }
.names { color:#ffcc66; }
<html><head>
<title>Alliance Border Patrol</title>
<link rel="stylesheet" type="text/css" href="index.css" media="screen">
<script type="text/javascript">
//<![CDATA[
function doStuff(el) {
var links=document.getElementsByTagName("a");
for(i=0;i<links.length;i++) {
if(links[i].className=="white") {
links[i].style.color="#cccccc";
}
}
el.style.color="#ffcc66";
}
//]]>
</script>
</head><body style="background:#000">
<script type="text/javascript">
<!--
function show_me(id){
document.getElementById("box2").innerHTML=document.getElementById(id).innerHTML
}
//-->
</script>
<div id="top">
<a href="index.html"><img src="img/your_mom.gif" alt="Alliance Border Patrol"></a>
</div>
<div id="left" class="data">
<br>
<a class="white" href="news.html" target="theframe" onclick="doStuff(this)" onfocus="this.blur()">NEWS    </a>
<br><br><br><br>
<a class="white" href="info.html" target="theframe" onclick="doStuff(this)" onfocus="this.blur()">INFO    </a>
<br><br><br><br>
<a class="white" href="rules.html" target="theframe" onclick="doStuff(this)" onfocus="this.blur()">RULES    </a>
<br><br><br><br>
<a class="white" href="roster.html" target="theframe" onclick="doStuff(this)" onfocus="this.blur()">ROSTER    </a>
<br><br><br><br>
<a class="white" href="gbank.html" target="theframe" onclick="doStuff(this)" onfocus="this.blur()">GBANK    </a>
<br><br><br><br>
<a class="white" href="pics.html" target="theframe" onclick="doStuff(this)" onfocus="this.blur()">PICS     </a>
</div>
<div id="right">
<iframe class="mframes" src="news.html" name="theframe" scrolling="auto" frameborder="0" marginwidth="15px" marginheight="0px" allowtransparency="true"></iframe>
</div>
<div id="bottom">
</div>
</body></html>
body{ text-align:center; position:relative; background-color: transparent; }
*{ text-decoration:none; margin:0; padding:0; }
img { border:0; }
#top { position:relative; top: 30px; }
#left { position:relative; font:small-caps 900 12px arial; float:left; text-align:right; top:80px; left:150px; }
#right { position: relative; background-image: url(img/border.gif); background-repeat:no-repeat; height: 500px; width:600px; top:40px; left: 250px; }
iframe { position: relative; top:35px; left:-31px; scrolling:auto; width:536px; height: 430px; //left:0px;}
.data { color: #cccccc; text-align:left; font:small-caps 900 18px arial;}
.data a:link { color:#cccccc; }
.data a:visited { color:#cccccc; }
.ext { color: #cccccc; text-align:left; font:small-caps 900 18px arial; }
.ext a:link { color:#ffcc66; }
.ext a:visited { color:#ffcc66; }
.names { color:#ffcc66; }