Rondra: div-container bündig aneinander legen

Beitrag lesen

hi nomma,
hab hier mal eine kleine testseite angelegt. hilft dir das ?

<?xml version="1.0" encoding="UTF-8"?>
<html>
<head>
<style type="text/css">
 body{margin:auto;pading:auto;}
 div
 {
  border:1px solid black;
 }
 div#main
 {
  width:100%;

}
 div#links {margin-left:0px;float:left}
 div#mitte {width:777px; float:left;}
 div#rechts {margin-right:0px;float:right}
</style>
<script type="text/javascript">
 var d = document;
 //getting browserwindow width
 function getWindowWidth()
{
 var windowWidth;
 if (navigator.appName=="Microsoft Internet Explorer") windowWidth = d.body.clientWidth;
 else windowWidth = window.innerWidth;
 return windowWidth;
}
 function resize()
{
 var winW = getWindowWidth();
 var boxes;
 if(winW > 777) boxes = (winW - 777) /2 + "px";
 else boxes = "0px";

d.getElementById("links").style.width= boxes;
 d.getElementById("rechts").style.width= boxes;

}
</script>
<body onload="resize()" onresize="resize()">
<div id="links">links</div>
<div id="mitte">mitte</div>
<div id="rechts">rechts</div>
</body>
</html>

lg
Rondra