How to fix background image inside div

While you cannot have a fixed background position within a div, the easiest solution would be to create a div the size of your image. Make the image the background, and set it to position:absolute in the top right corner of the div you want it placed in using right:0px;top:0px. Be sure that the parent div is position:relative or it won't be positioned absolutely within that div.


This behavior is actually correct. Any background which is attachment: fixed will be relative to the viewport, not the element it is applied to. This is actually the basis of Eric Meyer's Complex Spiral demo.