Web Hosting Talk







View Full Version : div and background-image


larwilliams
02-02-2009, 12:05 AM
Hi guys,
I'm work on a site for a client, and having some issues with a background image not appearing properly in Firefox.
http://www.lcwsoft.com/craneservicesltd/index.php
The background image is applied to a div with an ID of "containerBody", which contains the 2 divs for the client feedback and content bits.
In IE7, the purple(ish?) background appears properly and repeats vertically as expected.
In Firefox, it does not appear at all. I believe that the containerBody div is not expanding to fit its contents, but I cannot remember the solution. I thought it has something to do with position: and height:
Please help.

larwilliams
02-02-2009, 01:30 AM
UPDATE: it appears that setting overflow:hidden on #containerBody causes the page to render properly in Firefox too. Is this the right solution?

axiological design
02-02-2009, 02:10 AM
For one, try putting your bg info in one tag i.e. background: transparent url(images/main_bg.jpg). It will repeat by default. Also, try adding a height: auto; to your tag as well. That might fix the problem. If you're positioning anything inside that tag, you can set it to position: relative; top: 0; left: 0; or something similar. All of that should help.