Hey there, I've been working on a website http://m.navmana.com . It was going fine till i realized that if i make thew browser window smaller and scroll to the right a white band is appearing over the background image. I've tried adding:
What browser do you see the white band in? I don't see it in the ones I tried.
Resize your browser window and scroll to the right. The background stops at the size of the viewport.
Oh that! I was looking for a band across the blue.
Well, the header has no width and adapts to the initial viewport. Other stuff on the page has a fixed width in pixels and sticks out. Make the header as wide as the rest.
I'm afraid that's not it. Set any width to the header on his site and see what happens.
I'd make the background image (blueBg.png) as high as needed (500px) and apply it to BODY with repeat-x only.
Strange. Works for me. But I see now that the rest of the page is centered, so doing this doesn't have the desired effect, the header doesn't align with the rest of the page. What about doing what Frederiek suggested and use the background with BODY and then then give the header the same width as the rest and center it? That way the header will be aligned with the rest of the page and the background will stretch all the way to the left and right (which I think is what you want).
Well, just as Frederiek suggested I had previously done exactly that. creating the Bg to the full height of the band applying it to the body tag and repeat-x also i would add background-possition:top;
But the issue remains that this is just a patch up solution to this problem. especially when we have multiple bands that exceed on both ends for example, this particular site also has a band for the footer which also displays the white patch when scrolled to the right.
I've faced this issue many times in the past and it's really been scrambling my brain and i was hoping to figure out a more permanent solution to this problem.
**also is this method of segmenting the background color with css unusual for webdesigners? cos i haven't been able to find a direct solution to this on google either.
p.s.. thanks guys for the responses!
cheers
I don't see what's patchy about it.
Setting a width to #header doesn't make sense. It's only used as a hook-up for a structure à la HTML5 (e.g. header, section, footer). Inside each there's a .container div that has a width and is centered with margin.
Can you post the url of a test page with an attempt of my suggestion?
Alright guys, the solution was quite silly as I had anticipated. I looked up min-width and max-width in css and applied it.
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)