margins

liunx

Guest
a simple question, but i bet the answer is not.<br />
<br />
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:<br />
<br />
margin: -100px 0 0 0;<br />
<br />
in NS7 it moves up 100px.<br />
<br />
in IE6 it moves up 97px.<br />
<br />
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.<br />
<br />
any clues as to why? when you are working at the px level you would think things would be precise.<!--content-->How do you know the exact pixel ammounts? Do you like get a magnifying glass or something?<!--content-->Originally posted by Beach Bum <br />
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.<br />
<br />
any clues as to why? <br />
<br />
Becuse IE/Win is a piece of crap and the programmers that coded it can't count to 100. :D<br />
<br />
The workaround is to use another bug in IE to feed it an incorrect value of -103px which will move it the correct -100px.<br />
<br />
This thread shows a number of various parsing bug explotaitions for IE as well as other browsers:<br />
<!-- m --><a class="postlink" href="http://forums.webdeveloper.com/showthread.php?s=&threadid=356">http://forums.webdeveloper.com/showthre ... readid=356</a><!-- m --><!--content-->IE/Windows is not crap. IE is better than all the other browsers and if it isn't then what is then????<!--content-->Originally posted by Zach Elfers <br />
IE/Windows is not crap. IE is better than all the other browsers and if it isn't then what is then???? <br />
<br />
Well for starters neighter Gecko browsers nor Opera thinks 100px = 97px... only IE manages that...<br />
Learn to code webpages using theoretically correct code and you will see just how often IE manages to botch up even the simplest things.<!--content-->Sooo....<!--content-->Originally posted by Zach Elfers <br />
Sooo.... <br />
<br />
What, isn't the connection obvious enough for you?<br />
<br />
Massivly buggy software = crappy<!--content-->You're not mentioning all the problems with other browsers. IE displays things right even if they have buggs. I don't care.<!--content-->Originally posted by Zach Elfers <br />
You're not mentioning all the problems with other browsers. IE displays things right even if they have buggs. I don't care. <br />
<br />
How can IE display something "right" if it's incorrect?<br />
Obviously IE can't even display something right that _is_ correct...<br />
<br />
If you code you pages for NS 4 only everything will look "right" on it too...<br />
<br />
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.<br />
<br />
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...<!--content-->Zach,<br />
<br />
If the best browser is the browser that is most tollerant of errors, then Lynx (<!-- m --><a class="postlink" href="http://lynx.browser.org/">http://lynx.browser.org/</a><!-- m -->) is a far better browser than MSIE.<!--content-->didn't mean to start a browser war discussion.<br />
<br />
i was just wondering if anyone had encountered this and found a solution.<br />
<br />
obviously i can fudge the number, but then it makes the NS7 view off by the same amount the other way.<!--content-->Originally posted by Beach Bum <br />
didn't mean to start a browser war discussion.<br />
<br />
i was just wondering if anyone had encountered this and found a solution.<br />
<br />
<br />
Yes, and I linked to the solution in the first post, but here it is again for clarity.<br />
<br />
<br />
div.myDiv{<br />
margin: -103px 0 0 0; /* Used by IE5/win & IE5.5/win */<br />
voice-family: "\"}\""; voice-family:inherit;<br />
margin: -103px 0 0 0; /* Used by IE6/win */<br />
}<br />
<br />
html>body div.myDiv {margin: -100px 0 0 0;}<br />
<br />
<br />
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.<!--content-->Stefan -<br />
<br />
thanks for the solution. now i need to find where the problem starts.<br />
<br />
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.<br />
<br />
but i am sure that NS7 is doing it right and IE6 cannot count.<!--content-->
 
Back
Top