Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Dec 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Firefox CSS bug?

    I'm running IE6 and the latest version of FF.

    I'm playing with CSS1 and noticed that once again a big difference but oddly, this time IE got me the desired effect.

    Try it and you will notice that the margin-top in FF disregards that <p> is inside a <div> but it's correctly dispayed in IE.

    Here is the code:
    Code:
    <html><head><style type="text/css">
    <!--
    body { margin: 100px 100px 100px 100px; }
    div { height: 250px; letter-spacing:2pt; font-weight: bolder; color:red; }
    p { margin: 30px 30px 30px 30px; }
    --></style><title>Hey</title></head><body>
    <font face=impact>Hey!</font><br>
    <div style="background: #FFFFCC; color: #000000;">
    <p>Ready, set, go!</p>
    </div>
    </body></html>
    I'm sure there is a bypass, but is this a FF bug?
    Last edited by android; 12-16-2007 at 09:01 PM.

  • #2
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    Use padding instead of margin.

    Code:
    <html>
    <head>
    <style type="text/css">
     body 
     { 
      margin: 100px;
     }
     div 
     {  
      height: 250px;
      letter-spacing:2pt; 
      font-weight: bold; 
     }
     p 
     { 
      padding: 30px; 
     }
     .impact-font
     {
      font-family: Impact;
     }
     .section 
     {
      background-color: #ffc;
      color: #000;
     }
    </style>
    <title>Hey</title>
    </head>
    <body>
     <span class="impact-font">Hey!</span>
     <div class="section">
      <p>
       Ready, set, go!
      </p>
     </div>
    </body>
    </html>
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.

  • #3
    New Coder
    Join Date
    Dec 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You replied just as I was about to edit this thread. Found the padding thing in a later chapter of my lessons. Thanks though.

    I'm having fun with CSS.

  • #4
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    you could avoid browser default style using a rule in your css file.

    for example:

    Code:
    * { margin: 0; padding: 0; }
    best regards

  • #5
    Senior Coder ahallicks's Avatar
    Join Date
    May 2006
    Location
    Lancaster, UK
    Posts
    1,134
    Thanks
    1
    Thanked 57 Times in 55 Posts
    Quote Originally Posted by oesxyl View Post
    you could avoid browser default style using a rule in your css file.

    for example:

    Code:
    * { margin: 0; padding: 0; }
    best regards
    However, with this remember that you will need to reapply margins and padding to those that use them and you generally need, such as the <p> tag, and lists
    "write it for FireFox then hack it for IE."
    Quote Originally Posted by Mhtml View Post
    Domains are like women - all the good ones are taken unless you want one from some foreign country.
    Reputation is your friend

    Development & SEO Tools


  •  

    Posting Permissions

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