My website is distorted in FF and opera

Discussion in 'CSS' started by Cinta April, May 28, 2008.

  1. #1
    Hi i just made a website and it works fine in IE but today someone shoed me a version in firefox and it's distorted. I really don'tknow what went wrong, what codes needed to be modified, so if any of you have the experience about changing from IE made website to firefox, please tell me. the website is in my sig.
     
    Cinta April, May 28, 2008 IP
  2. pedroos

    pedroos Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well, where to begin... Its all in the css, it would be complicated to in a single message explain what's wrong. But check out the floats and positioning in your css.
    Does it work both in ie6 and ie7? Anyway i advise you to visit a few tuturial sites about css layouts, i think in a few minutes you'll figure out whats wrong.
     
    pedroos, May 28, 2008 IP
  3. rochow

    rochow Notable Member

    Messages:
    3,991
    Likes Received:
    245
    Best Answers:
    0
    Trophy Points:
    240
  4. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #4
    You don't have a proper DTD. That means your page is rendered in quirks mode, or non-standards compliant. In IE's case, that means their got-it-wrong box model. Opera tries to emulate IE, while Konqueror/Safari and Firefox never used that box model, and don't use it now for quirks.

    See Rendering Mode and Doctype Switching for an explanation.

    After applying the DTD to your page, IE and Opera will render like Firefox and Safari. You'll need to correct your values to reflect the proper rendering's box model rules. See http://www.w3.org/TR/CSS21/box.html

    After you get the DTD on, and if you have problems using the proper box model, come back for guidance.

    cheers,

    gary
     
    kk5st, May 28, 2008 IP
    rochow likes this.
  5. Cinta April

    Cinta April Banned

    Messages:
    262
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    it's not a matter of convention. it's just that when i set the width to 100 px for a div, the width gets to 100 px in IE. IN firefox it might expand a little. How do i fix the width for a div no matter what content i put in it?
     
    Cinta April, May 28, 2008 IP
  6. steelfrog

    steelfrog Peon

    Messages:
    537
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #6
    It is, actually, The DTD (Document Type Definition) tells the browser how to render the page. It's extremely important if you want to use CSS and most likely the cause of your problems.

    As far as Div widths are concerned, you might want to look into Box Models. In a nutshell, the box model determines how the width of elements is calculated. It differs from IE to most other browsers such as Firefox and Opera and will either require a hack or a work-around solution to get it to play nice.
     
    steelfrog, May 28, 2008 IP
  7. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #7
    Did you not read the references I linked? IE is the one screwed up, not Firefox. Get a DTD, and IE will follow the rules—as best it can. You'll still have some glitches due to IE's inherent stupidity, but those can be worked around. Running in quirks mode means x-browser compatibility becomes a PITA to achieve because IE doesn't follow the same rules as the modern browsers. In standards mode, it at least tries. Once you have the DTD in place, look at each of the elements that has that .8em margin, and reduce the width of that element by 1.6em.
     
    kk5st, May 28, 2008 IP
  8. cadence

    cadence Peon

    Messages:
    2
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Cinta, I went to your Ozucs website and literally gasped when I read this in your sidebar:

    The only thing true about that statement is that that Ozucs will display better for IE. The truth is, IE is the least programmer friendly user-oriented browser I know of. Especially version 6.

    It's bad practice to expect users to conform to broken code. I hope that doesn't sound too harsh, but you really need to get your hands dirty here and work it out.

    The links kk5st posted above are a great start.

    Good luck!

    cadence
     
    cadence, May 28, 2008 IP
    kk5st likes this.
  9. rochow

    rochow Notable Member

    Messages:
    3,991
    Likes Received:
    245
    Best Answers:
    0
    Trophy Points:
    240
    #9
    Yes, it is. Not following convention is why your site is screwed up in the first place.

    Fix those validation errors and it'll be a hell of a lot closer to working than it is now.
     
    rochow, May 28, 2008 IP
  10. Cinta April

    Cinta April Banned

    Messages:
    262
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    well my website has no dtd and is now compatible with firefox too. i still think IE is more programmer friendly.
     
    Cinta April, May 31, 2008 IP
  11. rochow

    rochow Notable Member

    Messages:
    3,991
    Likes Received:
    245
    Best Answers:
    0
    Trophy Points:
    240
    #11
    Then don't ask for help if you aren't even going to listen.
     
    rochow, May 31, 2008 IP
    kk5st likes this.
  12. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #12
    How does that apply to yourself? If you were a programmer, you'd at least try to get the html language's syntax right.

    Brings specificity to my sig line. :shrug:

    gary
     
    kk5st, May 31, 2008 IP