View Full Version : Background issue (shows in IE but not firefox)

10-24-2007, 04:32 PM
Here is my css. It displays perfectly in IE, but not in Firefox 2.0:

body {
background: url('images/bg.jpg') repeat-x top left #e61818 bottom right;

Any help would be GREATLY appreciated.

10-24-2007, 04:43 PM
Your syntax is off and likely FF is simply discarding the rule because it's invalid.

Typically I follow this convention for the background compound rule:

background: #color url(the/url.png) x y repeat-rule;

Notice that the url does not have single quotes, and x and y corresponds to the horizontal and vertical offset of the bg element (which can either be units such as percentages or pixels, or keywords). If you provide keywords like 'top' and 'left' the order is not significant, but if you provide units like 50% and 1em the parser expects the horizontal offset first.

So for your rule you'd need to rewrite it as:

body {
background: #e61818 url(images/bg.jpg) left top repeat-x;

Assuming you want it anchored to the top left (I do not know why you put bottom right also, which is contradictory).

10-24-2007, 04:58 PM
Thanks so much!!!