I'm afraid I think you canβt. You can use either right or the pixel value as the x-position of the image, but this pixel value will always refer to the left corner of the bounding box. Adding a padding also does not help, it just extends the bounding box.
The only solution I know for this is either adding a shift to the image itself, or using an absolutely positioned element (with a slight offset) that hangs behind the element - but for this you need to know the width and height in advance.
Edit: evil, hacker idea. I don't have time to try this right now, but it should work if h2 is a: block mapping.
Give h2 a position: relative .
Place a div or other element inside h2 with the following:
position: absolute; left: 0px; top: 0px; right: 5px; bottom: 0px; background-image: url(...); background-position: right center; background-repeat: no-repeat; z-index: -1;
this can lead to the desired effect, I'm not sure, since I have not tried. An element can overlay h2 other content, in which case you would need to put the rest into a <span> element with position: relative and z-index: 1 .
It really is hacked. Better put the gasket in the image, much cleaner.
source share