CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2005
    Location
    Milwaukee, WI
    Posts
    55

    Firefox doesn't play nice with margin-bottom

    Hi all,

    I'm developing a site and I've been testing it on IE6, IE7 beta3 and FireFox 1.5.0.4 (latest version).

    One of the things I wanted to do was set the margin-bottom to extend the length of a couple divs. This works great in all versions of IE greater than 4.x. Unfortunately when I try this in FireFox, it not only ignores the property (which I could handle), but it doesn't render the background image for the div at all anymore. Does anyone know what's up with this? Or better yet, have an alternative solution? I suppose I could grab the screen resolution and calculate a fixed length, but I'm not that picky with this app.

    Thanks in advance,
    Jeff G.

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Firefox doesn't play nice with margin-bottom

    Add marginwidth and marginheight to the body styles. Fortunately Firefox has a JavaScript console. Check in there as to why the margin is ignored.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Aug 2005
    Location
    Milwaukee, WI
    Posts
    55

    Re: Firefox doesn't play nice with margin-bottom

    Hi all,

    The properties marginwidth and marginheight don't exist. What I ended up doing was using the properties

    .somedivclass {
    background-image : url(images/someimage.gif);
    background-repeat : repeat-y;
    padding-bottom:100cm;
    }

    This does what I want it to in both Firefox and IE7.

    Thanks,
    Jeff

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: Firefox doesn't play nice with margin-bottom

    Quote Originally Posted by gitter1226
    The properties marginwidth and marginheight don't exist.
    Well, they do for the <body> tag which is what I though you were working with.

    My guess is that it has something to do with the tag since a <div> tag's display is inline. You can try setting the display to block. I don't know if it will work though.

    Code:
    .somedivclass {
    background-image : url(images/someimage.gif);
    background-repeat : repeat-y;
    padding-bottom:100cm;
    display: block;
    }
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  5. #5
    Join Date
    Aug 2005
    Location
    Milwaukee, WI
    Posts
    55

    Re: Firefox doesn't play nice with margin-bottom

    Ah, I see. Sorry I wasn't more clear. Thanks for the help.

  6. #6
    Join Date
    May 2002
    Posts
    10,943

    Re: Firefox doesn't play nice with margin-bottom

    Did that solve your problem?
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  7. #7
    Join Date
    Aug 2005
    Location
    Milwaukee, WI
    Posts
    55

    Re: Firefox doesn't play nice with margin-bottom

    Actually, no. I used what I posted earlier. I didn't need to use the display:block; property. We were just talking in circles around each other, lol.

    Thanks again.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured