Results 1 to 3 of 3

Thread: CSS Display and IE vs. Firefox

  1. #1
    Join Date
    Jan 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default CSS Display and IE vs. Firefox

    I'm having some problems getting CSS style buttons lined up correctly in Firefox. The test page in question is:
    http://www.drokpa.com/Hometst.php

    If you look at the page in IE it renders the way I want it to. It doesn't seem to matter if I use the class of 'mybutton', where it's 'display:block', or 'mybutton2', where it's 'display:inline'. Both look the way I want.

    If you look at the same page in Firefox, with 'display:block' I get the button outlined correctly, but it's not centered unter the text link. With 'display:inline' I get the button centered under the text link, but the outline of the button isn't correct.

    Can someone please tell me how to get the button outlined correctly, and positioned under the text link, in Firefox?

    Thanks in advance for your help............Brett

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The display:block; is the way to go with this:

    Code:
    .mybutton {
    border: 3px outset white;
    display: block;
    width:100px;
    margin:0 auto;
    }
    The margin:0 auto; is the way to center a block level element that has width. Using text-align:center should only work on inline elements and inline elements shouldn't fill out their borders. FF got it right but, IE was kinder about it. However, almost all browsers will do it like FF so, best to get it right so that you are not limited to an IE only audience.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Worked great....thanks.

    I'd also discovered that I could put <center></center> around my <a> and <img> tags and get it to work as well, but this is better.

    Brett

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
  •