I want to have a div with a background image specified in CSS, and I want the background image to appear at a certain offset. I already know how to do that part. I also want to be able to set an arbitrary size for the div, and for the image to be rescaled accordingly. That’s the part I’m having trouble with. I know about the background-size CSS attribute, but that doesn’t give me any way to have independent control over the X and Y axes.
Is this even possible? I only need to support recent versions of WebKit.
My mistake – the document that I linked to seems to be outdated.
background-sizedoes, in fact, allow for specifying the height and width independently, like this: