DIV element out of position in Firefox but not in IE

Discussion in 'HTML & Website Design' started by Drawn, Feb 25, 2009.

  1. #1
    Here's another cross-over issue between the two browsers: IE and Firefox

    Please, take the time to view my test website: www seemyinvestments dot com

    Using Internet Explorer, the geshi-generated source code file displays correctly.

    (geshi.php is installed with Joomla!, and allows one to display source code on a webpage in a pretty format. In this case, it's the index file for my Joomla! test website itself.)

    Using Firefox, however, you will see the problem...the source code file displays off screen to the right.

    If I remove the 'overflow:scroll' option from the style tag (see Code:), then Firefox has no problem.

    
    <div class="php" id="geshi-da3d" style="font-family:monospace;width:500px;height:500px;overflow:scroll;">
    
    Code (markup):
    However, I want the scrolling feature.

    Please, any suggestions?

    g
     
    Drawn, Feb 25, 2009 IP
  2. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #2
    If I've said it once, I've said it a million times. Never, ever use IE as a reference for how anything should work. It is 11 years behind web standards and the worst browser on the planet. If you coded a site that works in IE but not FF, then that tells me you only looked at FF after creating it in IE and THAT is your problem. You coded to a bug and now you have to dig out of it.

    You have an awful lot of stuff going on there for such a seemingly simple page. I'm not sure I have time to go through it but, in your CSS, you must supply units for measurements and one does not have px after it. Validating would have shown you that. You also have one HTML error but I forgot what it was. Validating would show you both.

    What we will find, eventually, is that IE is the problem and NOT Firefox.
     
    drhowarddrfine, Feb 25, 2009 IP
  3. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #3
    Remove overflow stuff from geshi-da3d

    EDIT: This has a serious case of div-itis plus table usage. Far, far too complicated to mess with.
     
    drhowarddrfine, Feb 25, 2009 IP
  4. Drawn

    Drawn Guest

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Introduced clear:both in the inline style command and it's all good in both IE and Firefox.

    
    <div class="php" id="geshi-da3d" style="font-family:monospace;width:500px;height:500px;overflow:scroll;clear:both">
    
    Code (markup):
    I will now continue to validate the webpage.
     
    Drawn, Feb 26, 2009 IP