Re: strange behavior with IE and margin...



"Luciano A. Ferrer" <algundiasabras@xxxxxxxxxxxx> wrote:

so, #botonera have a left margin of 18px, but IE make it 36px!
If I put a margin of 30px, IE make it 60px!
I am crazy?

No, it's IE that's is crazy.

#botonera {
float: left;
margin: 0 0 0 18px;
}

If you have a style with float: left and margin-left: XX then IE will
make margin-left twice the size it should be (and the same with float:
right and margin-right)

See http://www.positioniseverything.net/explorer/doubled-margin.html
for more details and some suggested fixes.

Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve@xxxxxxxx> <http://steve.pugh.net/>
.



Relevant Pages

  • Re: How to center nested divs
    ... I want to implement the navbar (ie, set of boxes linking to other ... margin-left: auto; ... margin-right: auto; ... You can't centre floats-- they float to one side or the other. ...
    (comp.infosystems.www.authoring.stylesheets)
  • DIV with rounded Corners (CSS) AND full height
    ... I'm having two DIV-Columns beside each other using float. ... margin-left: 12em; ... display: inline; ... /* we need this for IE 5.01 - otherwise the wrapper does not expand to ...
    (alt.html)
  • IE7/FF1.5 differences
    ... So I've tried float: left and now ... border-right: 1px dashed #888; ... padding-right: 8px; ... margin-left: 0; ...
    (alt.html)
  • Re: IE6 and IE7 shift text down in small browser window
    ... However, when the browser window gets narrow, IE pushes ... the text in the right-hand column to below where the left-hand column ... margin-left: 135px; ... float: left; ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: Horizontal CSS list, last entry right-aligned?
    ... vulpes wrote: ... I can separate it from the rest with ... margin-left: 10em, but that's very error-prone ... Using float: right almost works. ...
    (comp.infosystems.www.authoring.html)