Can't make div look the same height in IE6 and IE7

Reply

Join Date: Oct 2007
Posts: 1
Reputation: makz is an unknown quantity at this point 
Solved Threads: 0
makz makz is offline Offline
Newbie Poster

Can't make div look the same height in IE6 and IE7

 
0
  #1
Dec 18th, 2008
Hi, hope you can help me with this one.

I have a Div with five float divs inside:

HTML and CSS Syntax (Toggle Plain Text)
  1. var div=document.createElement("div");
  2. div.className="cssDivNino";
  3.  
  4. var divFolio=document.createElement("div");
  5. divFolio.className="cssFolio";
  6. div.appendChild(divFolio);
  7.  
  8. var divCurp=document.createElement("div");
  9. divCurp.className="cssCurp";
  10. div.appendChild(divCurp);
  11.  
  12. var divNombre=document.createElement("div");
  13. divNombre.className="cssNombre";
  14. div.appendChild(divNombre);
  15.  
  16. var divLocalidad=document.createElement("div");
  17. divLocalidad.className="cssLocalidad";
  18. div.appendChild(divLocalidad);
  19.  
  20. var divClear=document.createElement("div");
  21. divClear.className="clear";
  22. div.appendChild(divClear);
  23.  
  24. divFolio.innerHTML= someData;
  25. divCurp.innerHTML= someData;
  26. divNombre.innerHTML= someData;
  27. divLocalidad.innerHTML= someData;

This is the css:

HTML and CSS Syntax (Toggle Plain Text)
  1. .cssDivNino {padding: 0; margin: 0}
  2. .cssFolio {font-family:arial; font-size:10px; color:#000000; background-color:#FFFFFF; float: left; width: 7%; margin-right: 1%; padding: 0}
  3. .cssCurp {font-family:arial; font-size:10px; color:#000000; background-color:#FFFFFF; float: left; width: 17%; margin-right: 1%; padding: 0}
  4. .cssNombre {font-family:arial; font-size:10px; color:#000000; background-color:#FFFFFF; float: left; width: 36%; margin-right: 1%; padding: 0}
  5. .cssLocalidad {font-family:arial; font-size:10px; color:#000000; background-color:#FFFFFF; float: left; width: 35%; margin-right: 1%; padding: 0}
  6. .clear { clear:both; width: 0%; height: 0; padding: 0; margin: 0; border: thin; border-color:#000000}

This is how it looks in IE7 and Firefox and in IE6. Notice the extra space of the parent div behind the child divs under IE6.

I've tried to fix this with javascript:

HTML and CSS Syntax (Toggle Plain Text)
  1. div.style.height = divFolio.style.height;

But it doesn't work.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,210
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 166
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: Can't make div look the same height in IE6 and IE7

 
0
  #2
Dec 26th, 2008
You have size styles (width, height) and nonzero surrounding styles (margin, border, padding) in the same style, or applied to the same tag. This guarantees IE/FF incompatibilities.

It also does not help to define sizes in pixels. Use points or percents.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 45
Reputation: DiGSGRL is an unknown quantity at this point 
Solved Threads: 4
DiGSGRL's Avatar
DiGSGRL DiGSGRL is offline Offline
Light Poster

Re: Can't make div look the same height in IE6 and IE7

 
0
  #3
Jan 2nd, 2009
I have the same problems in IE7 IE6 IE5 and uh we don't look at the other IE browsers unless you want to cry.

IE made it possible to have different style sheets for different versions of IE or just for IE in general.

Of course you would first need to create a diff Css probably for IE6. We will call it IE6 here. Then inside your head where you call your Css files put in:
HTML and CSS Syntax (Toggle Plain Text)
  1. <!--[if IE 6]>
  2. <link rel="stylesheet" type="text/css" href="css/IE6.css" />
  3. <![endif]-->

You would place all the code inside that css file that is specific to IE6. You can do this for All IE at once by using:
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/IE.css" />
<![endif]-->
[/code]

It can be used for individual versions, all version, version 7+ all that good stuff.
A little clarification goes a long way.
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 1,283
Reputation: roryt will become famous soon enough roryt will become famous soon enough 
Solved Threads: 14
roryt's Avatar
roryt roryt is offline Offline
Nearly a Posting Virtuoso

Re: Can't make div look the same height in IE6 and IE7

 
0
  #4
Jan 2nd, 2009
I have never had any problems doing sizes in pixels. I have also never actually had the problem of different IE versions doing different things with my website. The only browsers you need to worry about are IE 6, 7 and 8 + FF + Opera. Then once they work the rest tend to control them in a similar way so your ok.

Makz, could you post a link to the page with your problem not an image. That might help people see exactly whats going wrong.

Thanks
PhotoShopthis
FlyingPen
If I have helped you please add to my reputation
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,210
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 166
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: Can't make div look the same height in IE6 and IE7

 
0
  #5
Jan 6th, 2009
Size parameters set in pixels don't make cross-browser compatibility problems. They create problems when different screen resolutions are used.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 1,283
Reputation: roryt will become famous soon enough roryt will become famous soon enough 
Solved Threads: 14
roryt's Avatar
roryt roryt is offline Offline
Nearly a Posting Virtuoso

Re: Can't make div look the same height in IE6 and IE7

 
0
  #6
Jan 6th, 2009
Midimagic:

The most detailed designs are made using pixels dimensions. There is simply no way to do it using percentages sometimes. And when done right pixel made layouts can work on almost any resolution. I realise there are always problems when moving to smaller browsers but even percentage set layouts have problems when made very small if not done correctly.

Now as for cross browser issues: speaking of FF and IE they both treat pixel and percentage widths the same way - one adds the padding set on to the width and the other presumes it is included in the set width (IE).
PhotoShopthis
FlyingPen
If I have helped you please add to my reputation
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum


Views: 2106 | Replies: 5
Thread Tools Search this Thread



Tag cloud for HTML and CSS
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC