Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2006
    Thanked 0 Times in 0 Posts

    IE equivalent of margin-top

    I have an image that I want to nudge down like 10px. So I declared a class in the style like this:

    <style type="text/css">
       .pic {
    then attached it to the image like so:

    <img src="blah.jpg" class="pic">

    As usual, this works fine in Firefox, but is completely ignored in IE. I know how to code CSS for IE only but I need to know the equivalent command to "margin-top" that IE actually listens to.

    any suggestions? thanks for your input guys

  • #2
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Splendora, Texas, United States of America
    Thanked 292 Times in 286 Posts
    I just tested this in Internet Explorer 6 and Firefox 1.5 and the CSS margin properties are working equivalently in either browser unless the image display is set to block, in which case Internet Explorer doesn't honor margins. However, the padding property continues to work so you could use that instead to achieve approximately the same effect. Otherwise, you could also set the image display to inline or surround it with a division tag.
    For every complex problem, there is an answer that is clear, simple, and wrong.


    Posting Permissions

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