, IE . , , , . , HTML, Javascript, .
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Blarg 2</title>
<style type='text/css'>
body { margin: 20px; width:1px}
#test { background: red; height: 500px; }
</style>
<script>
window.onload=windowResized;
window.onresize=windowResized;
function windowResized()
{
var cw = document.documentElement.clientWidth ;
var margin = 20 ;
document.getElementById("test").style.width=(cw-2*margin)+"px" ;
}
</script>
</head>
<body>
<div id="test" >
<input type='button'
onclick="javascript:window.showModalDialog('test.html', window, 'dialogWidth: 300px; resizable: yes;');" />
There is a bit more than meets the eye here.
</div>
</body>
</html>
<div>, . ( ), IE . document.documentElement.clientWidth. , , .
( , <div>), , IE, 1px. , " ", var margin = 20 ;, CSS margin. div height 500px, , , .
IE6/7/8 Chrome Windows XP, FF3.6 Chrome Mac. , , div , , , Javascript . , .