I have a background image, it's 2500 px wide yellow on both sides of a white block that is 940px wide and in the centre. I want it to repeat up and down so repeat-y.
How can I set the CSS so the background image always appears centre regardless of the screen res viewed at.
center keyword, like this:
background-position: center top; /* X-axis Y-axis */
When used in full shorthand version (background: [color] [image] [position] [repeat];) it looks somethink like this:
background: #f00 url(image.jpg) center 0 repeat-y;
A question, out of curiosity, why such a wide image? Couldn't you use a background color of yellow instead? (please comment on this answer to reply)
Great thanks, this works great. Yes I guess now I can center the background I can use background colour instead of such a wide image. Many thanks.