Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- MSIE % Margin problem.
November 28, 2004, 2:34 am
rate this thread
working on. http://darren.lychowyd.com/mono/ It works as I expect it to
in FireFox but it doesn't load properly in MSIE. When the page first
loads there is extra marging between my h1 and my 2 floating divs. When
you hover your mouse over one of the list-item links the margin
disappears and moves everything up to where I hoped it would be in the
first place. Can anyone explain this? Can anyone give me a solution to
Re: MSIE % Margin problem.
You are specifying top margin in percentage for those divs. Don't.
Percent of what? The viewport presumably, however IE actually uses the width
of the viewport not, as you might expect, the height. You can verify this by
draging the right border of your window around. As the width changes then so
does the gap above the divs.
When IE first lays out the page (on reload, or on change of window size)
uses the width of the viewport, that is the entire width of the browsers.
Now, roll over something. Things have changed so IE does a new layout.
However, this time the page has already been layed out. So, it sort of does
a re-layout. This time however it uses the width of the viewport minus a
possible scroll bar. Slightly smaller than before. You get that small
So, don't use % for that margin. Use em or px or furlongs or something