Jump to content

Differences between HTML 4.0 and 4.01


scorpion

Recommended Posts

I have noticed that if I use the Doc Statement:-

a href='http://www.w3.org/TR/html4/loose.dtd\>,'>http://www.w3.org/TR/html4/loose.dtd\">, IE7 fails to recognize one ID that I have placed within another ID. FF displays correctly.

 

IE7 displayed the two IDs corectly when I used the Doc Statement:-

 

The IDs in question are:-

#right {

float:right;

color:#E0E0E0;

background-color:#506F89;

width:130px;

margin-left:10px;

padding:1em;

}

 

#inner {

float:right;

color:#000000;

background-color:9EB1C0;

width:110px;

margin:3px;

padding:0.5em;

}

 

While the code is:-

What's New


<?php include("whatsnew.php"); ?>

 

The whatsnew.php just contains text:-

Exciting news on the "Walk The Y" front!

Check out the new Walk the Y page !

 

All the text is displayed correctly, just the inner box with the lighter color is missing in IE7.

 

The display differences can be seen in FF and IE7 at ww w.irish type3dna.o rg/About.p hp

 

Any clues as to why the Doc Statement is upsetting IE7? And any suggestions to correct?

Link to comment
Share on other sites

The second doctype is incomplete and although it works as you want in IE7 you should learn to use the correct doctype with the url.

 

Your style for the #inner div has a missing#

 

#inner {

float:right;

color:#000000;

background-color:#9EB1C0;/*was0EB1C0*/

width:110px;

margin:3px;

padding:0.5em;

}

 

which Firefox is clever enough to ignore. I originally drafted the answer below which works but is now unnecessary as the color code works if corrected.

 

Both your divs have a float which means that browsers assume that they have no height, so in your case, why does the inner div have a float? It's the only div in the #right div. It has a width of 110px in a 130px container so delete the float and change margin to margin: 3px auto;

Edited by Wickham
Link to comment
Share on other sites

Thanks Wickham ...I could kick myself with something being so simple!

 

I realised that the original DOC statement was incomplete, that's why I wanted to use the correct one ... but it caused IE7 to play up.

I guess the situation is when something is working you don't look again at that piece of code when, what seems to be a different problem, arises.

I have also taken your advice on the float and auto margin in the inner box too.

 

Cheers once again.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...