scorpion Posted November 4, 2009 Report Share Posted November 4, 2009 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? Quote Link to comment Share on other sites More sharing options...
Wickham Posted November 5, 2009 Report Share Posted November 5, 2009 (edited) 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 November 5, 2009 by Wickham Quote Link to comment Share on other sites More sharing options...
scorpion Posted November 8, 2009 Author Report Share Posted November 8, 2009 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.