Forum Moderators: open

Message Too Old, No Replies

Conditional statement like solution for FF3?

         

edacsac

4:17 pm on Mar 2, 2009 (gmt 0)

10+ Year Member



Firefox 3 has broken almost every web page I've made. Many pages I design I will usually create a centered wrapper or container div, then have a repeating background image that fits nice around the div. On some sites, I'll create a faux div border in the repeating background image.

This is how I center my wrapper div:
width:800px;
margin-left:-400px;
left:50%;

I usually have to specify a different container width or margin to make it all work between IE and FF, but now that FF3 is out, it too now renders differently, but I'm not finding any condition statement like solution.

I've been around and around, but there is nothing I can do to fix the inconsistencies between firefox versions. Most every page is noticeably broken because my centered div is over to the right one or two pixels in FF3. If I could assign a different background image or div size to the FF3 I'd be all set. Otherwise I don't know what to do!

Help?

rocknbil

11:16 pm on Mar 2, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For those that have a more positive solution, answer this: are you using a valid doctype and is it rendering in standards compliance mode? I.E. do the pages validate?

edacsac

12:23 am on Mar 3, 2009 (gmt 0)

10+ Year Member



This particular page does validate. It only has a background image, container div and a logo or header (which alerted me to the problem in FF3). And yes, a valid doctype (XHTML 1.0 Strict).

tedster

1:11 am on Mar 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That particular method for centering can be touchy sometimes - and the extra-clever bits are not necessary anymore, IMO.

I've been using these rules:

#main {
width:800px;
margin:0 auto;
}

... margin:auto plus a declared width for the main block handles centering with precision.

edacsac

8:56 pm on Mar 5, 2009 (gmt 0)

10+ Year Member



Thanks for the tip Tedster! I appreciate the help and it's making me look at other areas of my CSS for improvements.