www.webdeveloper.com
Results 1 to 7 of 7

Thread: why is mozilla ignoring the margin settings?

  1. #1
    Join Date
    Mar 2007
    Posts
    34

    Angry why is mozilla ignoring the margin settings?

    ive got a page with a menu at the top and content under it. i want a 50px space between the menu and the content. heres my code:

    Code:
    #content 	{
    		clear: both;
    		margin-top: 50px;
    		border: 5px solid #000000;
    		color: #000000;
    		background-color: #FFFFFF;
    		}
    in IE it shows up perfect. but in mozilla, there is no space at all. why is it ignoring the margin settings?

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Mar 2006
    Location
    Newcastle NSW Australia
    Posts
    4,033
    Is the menu floated by any chance?

  4. #4
    Join Date
    May 2005
    Posts
    2,040
    IE is 10 years behind web standards. Never, ever use IE as a reference for how things should work.

  5. #5
    Join Date
    Mar 2007
    Posts
    34
    Quote Originally Posted by Centauri
    Is the menu floated by any chance?
    yes, the logo and menu above are floated left and right - thats why i put clear:both for the content to cancel the float.

  6. #6
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Give the menu or logo a margin-bottom:50px remove the margin-top: 50px; from content.
    This would probably be better:
    Code:
    <div style="overflow:hidden; margin-bottom:50px;">
        <div id="menu">menu</div>
        <div id="logo">logo</div>
    </div>
    <div id="content">content</div>
    Read the links I gave; knowing the box model is essential to CSS layout.
    Clearing floats
    At least 98% of internet users' DNA is identical to that of chimpanzees

  7. #7
    Join Date
    Mar 2007
    Posts
    34
    ah cool Fang, that fixed it. thanks for the links too.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles