Log in

View Full Version : IE vs Firefox centering div (and a JQuery problem)



ltd33
11-04-2010, 09:17 PM
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.

ltd33
11-04-2010, 09:43 PM
I have added margin:auto; and now it works--is it really that simple??

Nile
11-04-2010, 11:49 PM
That should be how simple it is.

bluelight2
11-05-2010, 06:01 PM
Please anyone write details about the added margin:auto; and now it works--is it really that simple??

jscheuer1
11-05-2010, 06:15 PM
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.