Why does well written code that shows up on Chrome and Firefox look terrible on IE?

Discussion in 'HTML & Website Design' started by Matt Ridge, Sep 21, 2011.

  1. #1
    I have written a form, it looks great on Chrome and Firefox, but on IE it looks like a kid just used a drag and drop program and called it a day...

    Is there something I need to do to make IE treat my code with respect? I am using XHTML strict... if that helps at all.
     
    Matt Ridge, Sep 21, 2011 IP
  2. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #2
    IE has always been the worst browser on the planet. Inept at best, it is years behind all others in modern standards support and practices. In addition, the elements and properties it does support, it does so poorly. IE will never be a modern browser and is losing market share rapidly as the average person learns of how awful it is. No one who knows what they're doing uses IE.

    Without a link to your site, or the complete markup, we can't help with your problem.
     
    drhowarddrfine, Sep 21, 2011 IP
  3. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
  4. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #4
    Cheers to the fine Dr Fine, as always!!!


    Matt, you've got some minor issues all around there buddy..... Working some out now - give me a few minutes...
     
    workingsmart, Sep 21, 2011 IP
  5. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #5
    Actually - you're not that bad off... most of the issues are spacing / padding / margins in your css...

    By not having any type of reset in your css, by default you are allowing the browser to display items using their default padding, margins, etc... You need to declare these and or reset then declare these values in your stylesheet.

    Other than that, it appears that the general appearance overall, is the same in all browsers with the exception of some spacing and left alignment of areas without a container...

    Does that help or make sense?.. I know you've been learning and don't want to give you the solution straight out... :)
     
    workingsmart, Sep 21, 2011 IP
  6. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #6
    Actually it does, I going to add the padding in if it really did come to that, but I was hoping that the browsers themselves would be more uniform.

    Although what do you mean by having a reset?
     
    Matt Ridge, Sep 21, 2011 IP
  7. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #7
    Also, is there a way to only allow the padding to be used in IE only? Because I don't need extra padding for some browsers.
     
    Matt Ridge, Sep 21, 2011 IP
  8. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #8
    workingsmart, Sep 21, 2011 IP
  9. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #9
    I know browsers aren't uniform, but Firefox and Chrome seem to be pretty good on keeping the format clean... as I wrote it.

    As for the resets won't that override the rest of the CSS script below it?

    I only ask because of my newness... but also, as I asked before, is there a way to make it so that the padding is only used in IE? and ignored in browsers that actually follow CSS to the letter?
     
    Matt Ridge, Sep 21, 2011 IP
  10. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #10
    Ahh... well you're asking a question that has no direct answer.....

    But, for a straight answer to your question... YES you could add an IE only stylesheet with an IE hack like so...

    
    <!--[if IE]>
    <link rel="stylesheet" href="ie.css" type="text/css" media=screen" />
    <![endif]-->
    
    Code (markup):
     
    workingsmart, Sep 21, 2011 IP
  11. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #11
    Is it the right thing to do... In my opinion, NO!

    With a reset and some careful code planning, for your particular project, there should be no need for hacks and conditional items to appear or to be used.

    Besides, teaching you to work around rather than deal with the issues at hand only saves you time and doesn't not teach you the proper way to code...
     
    workingsmart, Sep 21, 2011 IP
  12. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #12
    Ok, but again won't the override if placed at the beginning override everything below it as well? Or am I mistaken?

    This is my CSS script.

    http://kaboomlabs.com/PDI/pdi.css
     
    Matt Ridge, Sep 21, 2011 IP
  13. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #13
    Whatever CSS you place in the ie.css file will only be used if the browser is any version of IE...

    
    <!--[if IE]>
    <link rel="stylesheet" href="ie.css" type="text/css" media=screen" />
    <![endif]-->
    
    Code (markup):
     
    workingsmart, Sep 21, 2011 IP
  14. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #14
    Sorry, I meant the original links you have offered... not the "cheat"...
     
    Matt Ridge, Sep 21, 2011 IP
  15. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #15
    The reset will NOT override any CSS declarations you make...
     
    workingsmart, Sep 21, 2011 IP
  16. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #16
    Thanks, that is what I wanted to make sure, the last thing I needed was to mess up my CSS :)
     
    Matt Ridge, Sep 21, 2011 IP
  17. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #17
    Last edited: Sep 21, 2011
    Matt Ridge, Sep 21, 2011 IP
  18. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #18
    Ok, after a long slog through editing things correctly, I have a question, how do I put spaces between the items? So they don't blend together in IE?

    What is the command, my brain isn't working to remember right now.

    Thanks
     
    Matt Ridge, Sep 21, 2011 IP
  19. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #19
    horizontal spacing? - meaning an html space?
    &nbsp;
    Code (markup):
    Via CSS use padding / margin...
     
    workingsmart, Sep 21, 2011 IP
  20. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #20
    wouldn't <br /> work better?
     
    Matt Ridge, Sep 21, 2011 IP