Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Background issue (shows in IE but not firefox)

    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.

  • #2
    Regular Coder
    Join Date
    Sep 2007
    Location
    Raleigh, NC
    Posts
    273
    Thanks
    7
    Thanked 59 Times in 52 Posts
    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).
    Last edited by vtjustinb; 10-24-2007 at 05:08 PM.

  • Users who have thanked vtjustinb for this post:

    timgolding (10-24-2007)

  • #3
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks so much!!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •