SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    margin-top not working in ie

    Hi Guys,

    Can't work out why this is happening. I have a margin-top:30px specified on my 'intro' div, which is working fine in Firefox and Safari, but for Internet Explorer it doesn't seem to show. The url is here:

    http://benredpath.co.uk/test/

    Any help greatly appreciated!

  2. #2
    Non-Member
    Join Date
    Jun 2010
    Location
    4727′35″N 2618′0″E
    Posts
    1,789
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's an IE8 specific bug, with margin collapsing for the first element after floated elements and clearing <div>s.

    You should move the div class="clear" inside div id="top-bar" to fix it.

    Code:
    <LI class="page_item page-item-2"><A title=ABOUT href="http://benredpath.co.uk/test/about/">ABOUT</A></LI></UL></DIV><DIV class=clear></DIV></DIV><!--end top-bar-->
    <DIV id=intro>

  3. #3
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey noonnope, thanks for your quick response.

    That fixes it in IE but in firefox the whole div 'top-bar' gets pulled down from the top of the viewport...any idea why this might be?

  4. #4
    Non-Member
    Join Date
    Jun 2010
    Location
    4727′35″N 2618′0″E
    Posts
    1,789
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use this:

    Code:
    #top-bar {
        overflow: hidden;
    }

  5. #5
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Awesome, thanks so much for your help!

  6. #6
    Non-Member
    Join Date
    Jun 2010
    Location
    4727′35″N 2618′0″E
    Posts
    1,789
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem. You're welcome.


Bookmarks

Posting Permissions

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