2014-01-30, 06:54:41
The Ultimate CSS Reference Copyright © 2008 SitePoint Pty Ltd
background-position: center top; /* same as 50% 0% */
to center the background image.
I don't think you can stretch a background image to make it 100% width, it is what width it is and displays pixel for pixel I think.
Quote:By default, the background-image is placed at the top-left (background-position) of the element; it’s repeated along the x and y axes (background-repeat) and will scroll with the document. These are the default settings that apply if you haven’t explicitly set any others, and can be adjusted with the other background properties.So you need
background-position: center top; /* same as 50% 0% */
to center the background image.
I don't think you can stretch a background image to make it 100% width, it is what width it is and displays pixel for pixel I think.