Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DIV behavior differs between FF and IE

0 views
Skip to first unread message

McKirahan

unread,
Jan 15, 2007, 5:47:58 PM1/15/07
to
Below is a stripped-down version of a Web page that works
differently between Firefox and Internet Explorer (IE) .

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 Forbes

unread,
Jan 17, 2007, 1:49:49 PM1/17/07
to
I tried it in both versions on my PC. They worked the same in both
browsers?

Jack


On Mon, 15 Jan 2007 16:47:58 -0600, "McKirahan" <Ne...@McKirahan.com>
wrote:

McKirahan

unread,
Jan 17, 2007, 6:04:51 PM1/17/07
to
"Jack Forbes" <HiJ...@fidnet.com> wrote in message
news:usrsq29l20m49aef2...@4ax.com...

> I tried it in both versions on my PC. They worked the same in both
> browsers?
>
> Jack

Thanks for your reply.

What version of IE did you use?

I used IE5.5. I'll try IE6.0 next.

McKirahan

unread,
Jan 17, 2007, 9:54:21 PM1/17/07
to
"McKirahan" <Ne...@McKirahan.com> wrote in message
news:2OadnSNeyvRzNzPY...@comcast.com...

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:

Jack Forbes

unread,
Jan 21, 2007, 3:07:28 PM1/21/07
to
I use IE 6.0.2900

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:

0 new messages