Link to home
Start Free TrialLog in
Avatar of damianb123
damianb123Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Issue with margin-top not working in IE11

Hi,
    I have an image which has the following style assigned (I know it's inline but want to get working before putting to a CSS file).....

<div style="margin-top: -17px;">
<img src....>
</div>

In Chrome and FF, this shows great, but in IE11 it ignores the margin-top.

is this a known issue, and is there a possible work around?

Cheers

Damian
Avatar of Robert Granlund
Robert Granlund
Flag of United States of America image

I just read this:
http://community.sitepoint.com/t/ie11-negative-margin-bug/40401
Maybe try changing the style to:
<div style="margin: -17px 0 0 0;">
Also try:
<div style="margin: -17px 0 0 0;clear:both;">
Avatar of damianb123

ASKER

Hi rgranlund,
    Nope, neither of those made a difference.  The first example didn't make any difference, the second example also made no difference.....

Do you have any other ideas?  I'm baffled?

Cheers for your help.
Try removing the negative sign to see if that does anything.  If so, you may need to add a media query definition. Increase the number and see if anything moves. View the code source in FF and see if the div and the image are lined up.
Yes, removing the negative i.e. -17px, to effectively '0' makes it look fine in IE, but then breaks it in FF and Chrome by having the image too low - perhaps another way of moving to top of div in FF and Chrome??
ASKER CERTIFIED SOLUTION
Avatar of Robert Granlund
Robert Granlund
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial