Make All the Browser Display DIV in the Same Width >>
<< Only UltraEdit Created XHTML-Strict File Works on Opera
Size of <DIV> on Different Browsers

Author Zhou Renjian Create@ 2004-07-13 22:57
whizz Note icon

Test code:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
 <title>Test &lt;DIV&gt; size on IE, Mozilla and Opera</title>
</head>
<body>
 <div id="testDIV" style="width:100px;border-style:solid;border-width:5px;border-color:gray;overflow:visible;">
  <div style="width:50px;background-color:navy;height:80px;">
  </div>
 </div>
 <script type="text/javascript">
  var jTestDIV = document.getElementById("testDIV");
  var strStatus = jTestDIV.scrollHeight + ":" + jTestDIV.clientHeight;
  window.status = (strStatus);
 </script>
</body>
</html>

On IE: outer size: 100x90 inner size: 90x80 scroll size:  90x80  client size: 90x80
On Mozilla: outer size: 110x90 inner size: 100x80 scroll size: 110x90 client size: 0x0
On Opera: outer size: 110x90 inner size: 100x80  scroll size: 110x85 client size: 110x80
Offset size...

本记录所在类别:
本记录相关记录: