Skip to main content
This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

MurraySummers
Inspiring
July 10, 2010

body { background-attachment:fixed; }

Be aware that your background would have to tile properly to make this look right (note the visual repeat in the background on your linked page).

Translate
Participant
July 10, 2010

Hmmmm.... thats cool, but this is not quite what I am after. I don't

want the image to repeat, I only want there to be H-scroll bars

appearing when the window is reduced past the width of the main image

(or the main content divs) - not when it passes the width of the

wrapper.

So to summarise I don't want the scroll bars to care about the wrapper

div if the browser window cannot fit it in... I also don't want the

centering of the page to be based on the wrapper div, so when you

reduce the browser size everything inside the wrapper div remains

centered even though the wrapper has cropped some width.

Does that make sense?

Maybe it's a simple case of taking the wrapper div out of the context

of the rest of the page, and tell it never to have scroll bars. Then I

would have the centering the way I want it too?

- E

Translate
MurraySummers
Inspiring
July 10, 2010

I don't

want the image to repeat, I only want there to be H-scroll bars 

appearing when the window is reduced past the width of the main image 

(or the main content divs) - not when it passes the width of the 

wrapper.

Sounds like you would want an arrangement such as this -

Body - uniform background color with background image that centers using background-position:center.

Wrapper - fixed width, centering containing body content.

Is that what you are looking for?  The wrapper will always center in the browser, as will the background image behind it.  Horizontal scrollbars will only appear when the viewport width is less than the wrapper width.

Translate