Jump to content

Recommended Posts

Posted

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?

Posted (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 by Wickham
Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...