Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > CSS
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

CSS CSS styling code help for your website, CSS is like art and what makes your website look professional.

Google
Reply
 
LinkBack Thread Tools Display Modes
Old 07-01-2007, 1:17 PM   #1
McKirahan
 
McKirahan's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default DIV behavior differs between FF and IE

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>


 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Advertisements
Old 07-01-2007, 1:17 PM   #2
Jack Forbes
 
Jack Forbes's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default DIV behavior differs between FF and IE

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" <News@McKirahan.com>
wrote:

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

 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 1:17 PM   #3
McKirahan
 
McKirahan's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default DIV behavior differs between FF and IE

"Jack Forbes" <HiJack@fidnet.com> wrote in message
news:usrsq29l20m49aef2quvfhgt1p2g33d6oi@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.



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 1:17 PM   #4
McKirahan
 
McKirahan's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default DIV behavior differs between FF and IE

"McKirahan" <News@McKirahan.com> wrote in message
news:2OadnSNeyvRzNzPYnZ2dnUVZ_oGlnZ2d@comcast.com. ..
> "Jack Forbes" <HiJack@fidnet.com> wrote in message
> news:usrsq29l20m49aef2quvfhgt1p2g33d6oi@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.


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:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 1:17 PM   #5
Jack Forbes
 
Jack Forbes's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default DIV behavior differs between FF and IE

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" <News@McKirahan.com>
wrote:

>"Jack Forbes" <HiJack@fidnet.com> wrote in message
>news:usrsq29l20m49aef2quvfhgt1p2g33d6oi@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.
>
>

 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Featured Websites
Free Space
Free Space
Free Space Free Space
Reply
Tags: , , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Behavior using MySQL Matt White PHP 4 05-20-2007 5:33 PM


Featured Websites




All times are GMT +1. The time now is 8:30 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98