1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Cross browser inconsistency

Discussion in 'HTML & Website Design' started by mcfc4eva, Jan 29, 2009.

  1. #1
    My website www.pheel.co.uk/expect_test seems to display fine in IE7 but with firefox it has a few inconsistencies, such as not centering and making the header cell too big! How can I fix this?

    Another problem is it's loading time, if anyone has any ideas to fix this, i'm all ears.:rolleyes:
     
    mcfc4eva, Jan 29, 2009 IP
  2. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #2
    The problem, as always, is IE. You don't have a doctype. Without one, IE goes into quirks mode and doesn't attempt to perform like modern browsers do, such as Firefox. (IE is NOT a modern browser). In addition, you used IE as your initial test browser, so now you marked the page up according to the worst browser on the planet.

    So, add this as the first line of your markup to pull IE into the modern world:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">

    Then let's see where we stand. Unfortunately, this may change things around in IE because we're changing the rules; but it must be done to keep all browsers on the right page.
     
    drhowarddrfine, Jan 29, 2009 IP
  3. cscott5288

    cscott5288 Active Member

    Messages:
    912
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #3
    In the CSS body, replace margin-left:0; margin-right:0; with text-align:center; and replace text-align:center; with margin: 0 auto;
    width: 881px;
    in the "#all" div

    EDIT: a doctype is recommended but is not affecting any of the visual elements of your page.
     
    cscott5288, Jan 29, 2009 IP
  4. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #4
    A doctype is REQUIRED for modern pages and it most definitely is affecting ALL visual elements on the page! You will NEVER get IE in line without one!
     
    drhowarddrfine, Jan 29, 2009 IP
  5. cscott5288

    cscott5288 Active Member

    Messages:
    912
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #5
    well that's an erroneous statement if i've ever heard one.

    this doesn't have anything to do with our little discussion over here: http://forums.digitalpoint.com/showthread.php?t=1209544

    now does it?
     
    cscott5288, Jan 29, 2009 IP
  6. eric.r

    eric.r Peon

    Messages:
    124
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    No. A doctype is not required in any html page. However, not doing so throws browsers into quirks-mode and will thus cause the browser to not conform to the standards, however little they are considered, especially by IE. Being in quirks mode will render your html differently and in order to have 'cross browser consistency you should include a doctype.

    ~eric
     
    eric.r, Jan 29, 2009 IP
  7. mcfc4eva

    mcfc4eva Well-Known Member

    Messages:
    602
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    110
    #7
    Yeh, I tried putting a doctype in there, but all the xhtml and html doctypes just made the page act differently... so i removed it again.
     
    mcfc4eva, Jan 29, 2009 IP
  8. mcfc4eva

    mcfc4eva Well-Known Member

    Messages:
    602
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    110
    #8
    Okay the page is centered now thanks to cscott5288 (thanks a lot buddy!:D)

    But there is still two problems;
    • The content title section is larger in Firefox tha IE
    • and the enquiry form isn't centered in FireFox but it is in IE

    If anyone can help I'd be grateful!

    Thanks,
    Michael
     
    mcfc4eva, Jan 29, 2009 IP
  9. eric.r

    eric.r Peon

    Messages:
    124
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Seriously man. Add a doctype. To everyone but you, removing the doctype makes everything look different :rolleyes:. Add a 4.01 html strict doctype. Then validate your html and css. Then post here again and I will help you out. It is much easier to make cross browser consistencies with validated code. Trust me.

    ~eric
     
    eric.r, Jan 29, 2009 IP
  10. mcfc4eva

    mcfc4eva Well-Known Member

    Messages:
    602
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    110
    #10
    Thanks eric, but validating it in css and html will take so long, I'd rather just get a quick fix and move on.
     
    mcfc4eva, Jan 29, 2009 IP
  11. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #11
    Note the caveat I made: "modern web pages". No modern web pages should be in quirks mode.
     
    drhowarddrfine, Jan 29, 2009 IP
  12. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #12
    You just try and create a web page that works across all the browsers without one and then come back and tell me it's erroneous. Oh, wait! He did that and it's not working across browsers...and it doesn't have a doctype! And what's the advice given? Add a doctype!

    By its very definition, no doctype means you are in quirks and living in 1998 and HTML 3.2 or earlier.
     
    drhowarddrfine, Jan 29, 2009 IP
  13. cscott5288

    cscott5288 Active Member

    Messages:
    912
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #13
    cscott5288, Jan 29, 2009 IP
  14. mcfc4eva

    mcfc4eva Well-Known Member

    Messages:
    602
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    110
    #14
    Anyway...
    Can anyone help with my problem:confused:
     
    mcfc4eva, Jan 29, 2009 IP
  15. eric.r

    eric.r Peon

    Messages:
    124
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Sorry about the arguments.

    But you are saying they are , and i quote, "REQUIRED". And I see plenty of sites that use this old <html><head> tradition. You can make ie "in line" without a doctype. The less code there is, the less there is to break. Quirks mode only makes it so the browser won't conform to the standards set by adding a doctype. If you add a doctype then you are basically signing a document saying you will not break the rules/standards of this doctype. If you do then thats why the validator throws errors at you.

    @csscott

    LOL

    @mcfc4eva

    I know it seems long and tedious but validating your html and css won't take that long. If you coded right then you won't have any/ very few. If you are that lazy :cool: then you have the option of letting the html validator only validate your code. Unfortunately the CSS validator makes you do the work. Trust me on this. It will be time well spent if you add a doctype and validate your html and css. It doesn't always have to be perfect though. Just validate your big errors like incorrectly nested elements, and typos (yes the validator throws them out at you). Validation is the first step in the solving process

    ~eric
     
    eric.r, Jan 29, 2009 IP
  16. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #16
    You can not. Without a doctype, IE goes into quirks mode and uses the broken box model, misplacing margins and padding along with other misrepresentations I don't recall. That was from the late 1990s, folks. Read the docs. A proper doctype is required for conformance. You guys do read the W3C docs regularly, don't you?
     
    drhowarddrfine, Jan 29, 2009 IP
  17. mcfc4eva

    mcfc4eva Well-Known Member

    Messages:
    602
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    110
    #17
    Eric, my site now only has 1 small error, (the header cell). Please don't patronise me explaining the reasons for programming in valid html/css. I know the reasons for doing it, and I know how to do it - I started making that site without considering it's validity and I'm kind of regretting it now, but lets face it there is one small glitch and apart from that the site is complete. I am not going to go back and start again or validate it just to please you.

    Now that's clear, does anyone have a solution to the layout problem that doesn't include adding a doctype or validating it? :p
     
    mcfc4eva, Jan 29, 2009 IP
  18. mcfc4eva

    mcfc4eva Well-Known Member

    Messages:
    602
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    110
    #18
    Unless your going to help out without blabbering on about the importance of doctypes, please don't comment any more in this thread.

    Thank you
     
    mcfc4eva, Jan 29, 2009 IP
  19. eric.r

    eric.r Peon

    Messages:
    124
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #19
    Yes you can which brings me to my point saying
    ~eric
     
    eric.r, Jan 29, 2009 IP
  20. mcfc4eva

    mcfc4eva Well-Known Member

    Messages:
    602
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    110
    #20
    fixed it without validating it or adding doctypes

    thank you cscott5288 for your contribution!

    thanks for the rest of your comments, shame that none of them made a difference or helped me.
     
    mcfc4eva, Jan 29, 2009 IP