Hallöchen:
ich möchte einen leeren div mit width:100% spannen. Der IE6 versteht's einigermaßen, aber beim NS4.7 sehe ich nur einen mini-kleien Spalt (habe aus Spaß ein eingefügt). Wieso zeigt der doofe Netscape nicht den div über die gesamte Browserbreite???
Hier mal der Quelltext (nicht am Javascript stören, bitte):
//format.css:
body {
background-color:#004F35;
}
.yellowDiv {
position:absolute;
background-color:#CCAE2E;
top:0px;
width:100%;
min-width:100%;
max-width:100%;
height:304px;
}
//index.htm:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>index.htm</title>
<link rel="stylesheet" href="format.css" type="text/css" />
<script type="text/javascript">
<!--
// simple browser-check:
var ns4 = (document.layers);
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);
var yellowHeight = 304;
function getClientWidth(){
if (window.innerWidth)
return window.innerWidth;
else if (document.body && document.body.offsetWidth)
return document.body.offsetWidth;
}
function getClientHeight(){
if (window.innerHeight)
return window.innerHeight;
else if (document.body && document.body.offsetHeight)
return document.body.offsetHeight;
}
function init(){
clWidth = getClientWidth();
clHeight = getClientHeight();
yellowTop = (clHeight / 2) - (yellowHeight / 2);
if(ns4)
document.layers["yellowDiv"].top = yellowTop;
else if(ie4)
document.all["yellowDiv"].style.pixelTop = yellowTop;
else if(ie5 || ns6)
document.getElementById("yellowDiv").style.top = yellowTop;// document.all["yellowDiv"].style.pixelTop = yellowTop;
}
//-->
</script>
</head>
<body onLoad="init()">
<div class="yellowDiv" id="yellowDiv"> </div>
kann mir da jemand weiterhelfen??