Results 1 to 5 of 5

Thread: IE vs Firefox centering div (and a JQuery problem)

  1. #1
    Join Date
    Nov 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default IE vs Firefox centering div (and a JQuery problem)

    This is probably a dumb question but my brain is tangled and I can't figure it out. In IE the div #photo-box is centered and in Firefox it goes left. I keep running into this. What is the solution?

    http://www.heartwoodnurseryinc.com/index_slide.html

    Also the images in the photo_box are supposed to be a slideshow but it just won't work and I can't seem to figure it out, either. I will take that question to a javascript area but I wanted to explain what was going on there.

  2. #2
    Join Date
    Nov 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I have added margin:auto; and now it works--is it really that simple??

  3. #3
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    That should be how simple it is.
    Jeremy | jfein.net

  4. #4
    Join Date
    Nov 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Pls write details

    Please anyone write details about the added margin:auto; and now it works--is it really that simple??
    Last edited by djr33; 11-05-2010 at 10:12 PM. Reason: spam removed

  5. #5
    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

    On a standards compliant web page that sets the left and right margins to whatever they need to be to center a block level element of explicit width. It also sets the top and bottom margins to 0.

    It is preferred over align: center, and other center type strategies (like the <center> tag and the align="center" attribute) as it only centers the element, not stuff inside of it, which can be a real problem in some browsers visa vis some markup and/or some script generated markup.
    - John
    ________________________

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

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
  •