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"
<html xmlns="" lang="en-US" xml:lang="en-US">
 <title>Test &lt;DIV&gt; size on IE, Mozilla and Opera</title>
 <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;">
 <script type="text/javascript">
  var jTestDIV = document.getElementById("testDIV");
  var strStatus = jTestDIV.scrollHeight + ":" + jTestDIV.clientHeight;
  window.status = (strStatus);

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...