Background images and sidescrolling

Discussion in 'CSS' started by CriminalOrigins, Aug 5, 2007.

  1. #1
    Hey there,
    I need help with a problem that has me pretty much stumped.

    I've got a page that has side-scrolling (yes, it has to side-scroll, there's no changing that). I need to make a div expand to the full width of the browser (including side scrolling) so I can make a background image reach all the way accross.

    Right now, the background image reaches across the browser, but when you side-scroll, the image stops and there's just blank white space after that.

    Thanks!
     
    CriminalOrigins, Aug 5, 2007 IP
  2. Courtenay

    Courtenay Peon

    Messages:
    63
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Can you provide a link?
     
    Courtenay, Aug 5, 2007 IP
  3. CriminalOrigins

    CriminalOrigins Peon

    Messages:
    276
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    CriminalOrigins, Aug 5, 2007 IP
  4. Courtenay

    Courtenay Peon

    Messages:
    63
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Ah, you have me stumped too. I've come across this problem before and I do remember solving it but can't remember how. Have you tried setting #centered to width: 100%;?

    Why is it that you must have side scrolling?

    Also, you might want to add this to your style sheet for less headaches:

    
    * {
        margin: 0;
        }
    
    Code (markup):
     
    Courtenay, Aug 5, 2007 IP
  5. Courtenay

    Courtenay Peon

    Messages:
    63
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Also, you've used #centered twice. Either make it a class or make a seperate id for the second one.
     
    Courtenay, Aug 5, 2007 IP
  6. CriminalOrigins

    CriminalOrigins Peon

    Messages:
    276
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    #bar actually isn't contained in #centered, so it wouldn't make that much of a difference...

    I really hate side-scrolling, but my client really wants the wide look since he's on a big resolution..

    Oh, and thanks for the tip, I never realized you could do that shortcut :p

    EDIT: I realize I used centered twice, the bar was originally contained inside centered but I took it out and started another "centered" div for convenience. If it had actually worked I would've renamed the div.
     
    CriminalOrigins, Aug 5, 2007 IP