dcsimg
www.webdeveloper.com
Results 1 to 13 of 13

Thread: margins

  1. #1
    Join Date
    Nov 2002
    Posts
    421

    margins

    a simple question, but i bet the answer is not.

    when doing a page layout and moving an image (or anything else - i have the same result with lists) back up on the page i am using:

    margin: -100px 0 0 0;

    in NS7 it moves up 100px.

    in IE6 it moves up 97px.

    i have found that IE is consistently "off" by 3px from what i tell it to do every time i use a negative margin. it goes up 3px less than it should.

    any clues as to why? when you are working at the px level you would think things would be precise.

  2. #2
    Join Date
    Nov 2002
    Posts
    631
    How do you know the exact pixel ammounts? Do you like get a magnifying glass or something?

  3. #3
    Join Date
    Nov 2002
    Posts
    984

    Re: margins

    Originally posted by Beach Bum
    i have found that IE is consistently "off" by 3px from what i tell it to do every time i use a negative margin. it goes up 3px less than it should.

    any clues as to why?
    Becuse IE/Win is a piece of crap and the programmers that coded it can't count to 100.

    The workaround is to use another bug in IE to feed it an incorrect value of -103px which will move it the correct -100px.

    This thread shows a number of various parsing bug explotaitions for IE as well as other browsers:
    http://forums.webdeveloper.com/showt...=&threadid=356

  4. #4
    Join Date
    Nov 2002
    Posts
    631
    IE/Windows is not crap. IE is better than all the other browsers and if it isn't then what is then????

  5. #5
    Join Date
    Nov 2002
    Posts
    984
    Originally posted by Zach Elfers
    IE/Windows is not crap. IE is better than all the other browsers and if it isn't then what is then????
    Well for starters neighter Gecko browsers nor Opera thinks 100px = 97px... only IE manages that...
    Learn to code webpages using theoretically correct code and you will see just how often IE manages to botch up even the simplest things.
    Last edited by Stefan; 12-06-2002 at 11:53 PM.

  6. #6
    Join Date
    Nov 2002
    Posts
    631
    Sooo....

  7. #7
    Join Date
    Nov 2002
    Posts
    984
    Originally posted by Zach Elfers
    Sooo....
    What, isn't the connection obvious enough for you?

    Massivly buggy software = crappy

  8. #8
    Join Date
    Nov 2002
    Posts
    631
    You're not mentioning all the problems with other browsers. IE displays things right even if they have buggs. I don't care.

  9. #9
    Join Date
    Nov 2002
    Posts
    984
    Originally posted by Zach Elfers
    You're not mentioning all the problems with other browsers. IE displays things right even if they have buggs. I don't care.
    How can IE display something "right" if it's incorrect?
    Obviously IE can't even display something right that _is_ correct...

    If you code you pages for NS 4 only everything will look "right" on it too...

    The point here is that if the code you have does NOT display as it's theoretically supposed to, then that is a bug in the browser NOT a good feature as you seem to believe.

    And as for "not mentioning all the problems with other browsers", all software has bugs, there is no such thing as a perfect program. It's just that IE got so many more bugs then other browsers it's not even funny...
    Last edited by Stefan; 12-07-2002 at 12:15 AM.

  10. #10
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    Zach,

    If the best browser is the browser that is most tollerant of errors, then Lynx (http://lynx.browser.org/) is a far better browser than MSIE.

  11. #11
    Join Date
    Nov 2002
    Posts
    421
    didn't mean to start a browser war discussion.

    i was just wondering if anyone had encountered this and found a solution.

    obviously i can fudge the number, but then it makes the NS7 view off by the same amount the other way.

  12. #12
    Join Date
    Nov 2002
    Posts
    984
    Originally posted by Beach Bum
    [B]didn't mean to start a browser war discussion.

    i was just wondering if anyone had encountered this and found a solution.
    Yes, and I linked to the solution in the first post, but here it is again for clarity.


    div.myDiv{
    margin: -103px 0 0 0; /* Used by IE5/win & IE5.5/win */
    voice-family: "\"}\""; voice-family:inherit;
    margin: -103px 0 0 0; /* Used by IE6/win */
    }

    html>body div.myDiv {margin: -100px 0 0 0;}


    In this case I have assumed that IE 5.x also is exactly 3px off. That is not nessecarily the case, so you might need to tweak the value of the first occurance of margin.

  13. #13
    Join Date
    Nov 2002
    Posts
    421
    Stefan -

    thanks for the solution. now i need to find where the problem starts.

    if i run one margin test by itself everything is OK. it appears that IE gets confused when you make a complex page with a lot of bouncing around (as I am doing). i may just give up and accept the fact that there may be a few px difference in some cases.

    but i am sure that NS7 is doing it right and IE6 cannot count.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles