IE/FF Compatibility Error on Simple Code

Discussion in 'CSS' started by sunster13, Jul 10, 2007.

  1. #1
    Hey guys, could you please take a look at my code:

    http://www.sportsgfx.net/tests/css/

    As you can see, in FF text-align: center doesn't appear to be working, along with the line that seems to be separating the content from the nav bar for some reason.

    It works pretty much the way it should in IE.

    Thanks for your help.
     
    sunster13, Jul 10, 2007 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    What do you expect to happen? When text is added, it is indeed centered.
    
    <div id="midarea">
      <p>centered text?</p>
      <div id="content">
        <div id="bluenav"/> <!-- not good practice -->
      </div>
      <div id="bottombar"/> <!-- again, empty block element and shorthand close -->
    </div>
    Code (markup):
    If IE renders one way, and Firefox another, assume IE got it wrong.

    cheers,

    gary
     
    kk5st, Jul 10, 2007 IP
  3. haruko764

    haruko764 Peon

    Messages:
    25
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Seconding the suggestion to assume that IE got it wrong. Always code to Firefox first, it is more compliant. Then make adjustments for IE.

    Also, about the empty block elements: kk5st is right, its bad practice. However, when doing a page layout with CSS and creating a div solely for an image, you're going to end up with them, right? What I usually do:
    
    <style>
    .hidden{display:none;}
    #picture{background-image:url('blahblah.jpg');}
    </style>
    <div id="picture">
    <p class="hidden">
    Filler
    </p>
    </div>
    Code (markup):
    But I still haven't addressed your issue. My best input is just to code to Firefox first and then work around to IE, like I said. For starters, don't use text-align:center; to align a div. Use margin:0 auto; or simply margin:auto;.
     
    haruko764, Jul 10, 2007 IP
  4. sunster13

    sunster13 Active Member

    Messages:
    169
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    sunster13, Jul 10, 2007 IP
  5. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Dan Schulz, Jul 13, 2007 IP
  6. bpb2221

    bpb2221 Peon

    Messages:
    83
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I agree with Dan. I use FF, but I am a developer and I know that only 15% of web users are using it too. So I always check in this order: IE6 (slogan: it's better than 5.5!), IE7, FF, Safari, Opera.

    Back to sunster's problem. It looks like you added the box you were looking for, are you trying to add something else?
    What do you want to add padding to?
     
    bpb2221, Jul 14, 2007 IP
  7. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I don't check in any given order. I check them all at the same time (not the exact same time mind you, but I check after adding or changing an element/style/script/component).
     
    Dan Schulz, Jul 15, 2007 IP