There are three nested tables; table_3 inside table_2 inside table_1.
There's DIV with id="content" that is inside table_1.
There's a JavaScript function that toggles the size of the DIV's text.
Under Firefox all text is resized.
Under IE only the text inside table_1 is resized.
Which behavior is correct?
How do I make it consistent for both browsers?
FYI -- The "doctype" tag does make a difference.
Thanks in advance.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>CSS_Test.htm</title>
<script type="text/javascript">
var size = 0;
function textSize() {
if (!document.getElementById) {
alert("This feature requires a modern browser.");
return;
}
(size==1) ? size=0 : size=1;
var list = new Array("80%","100%");
var item = list[size];
document.getElementById("content").style.fontSize = item;
}
</script>
<style type="text/css">
td, th { font-size:100% }
.font { font-size:80% }
</style>
</head>
<body>
<input type="button" value="Change Text Size" onclick="textSize()">
<br><br>
<table border="1" width="150">
<tr>
<th>
<div id="content" class="font">
<table border="1" width="130">
<tr>
<th>
<table border="1" width="110">
<tr>
<th class="font">
Hello World 1
</th>
</tr>
</table>
<br>
Hello World 2
</th>
</tr>
</table>
<br>
Hello World 3
</div>
</th>
</tr>
</table>
<ul>
</ul>
</body>
</html>
Jack
On Mon, 15 Jan 2007 16:47:58 -0600, "McKirahan" <Ne...@McKirahan.com>
wrote:
Thanks for your reply.
What version of IE did you use?
I used IE5.5. I'll try IE6.0 next.
I got consistent behavior by changing the DTD to "quirks" mode per:
http://www.htmlhelp.com/tools/validator/doctype.html
"Newer browsers such as Internet Explorer 5 for Mac,
Netscape 6, and Mozilla use a standards-compliant rendering
for HTML 4.01 Transitional documents that include the URI
of the DTD in the DOCTYPE.
These browsers use a "quirks" mode to emulate rendering
bugs in older browsers if the URI is omitted:"
I changed:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
to just:
I'm resisting as long as I can going to version 7.
Jack
On Wed, 17 Jan 2007 17:04:51 -0600, "McKirahan" <Ne...@McKirahan.com>
wrote: