I think the answer is no, but can you position a background image with CSS, so that it is a fixed amount of pixels away from the right?
If I set background-position
values of x and y, it seems those only give fixed pixel adjustments from the left and top respectively.
Give it a shot. Essentially, background-position: 90% 50% will make the right edge of the background image line up 10% away from the right edge of the container. Create a div containing the image. Explicitly set the position of the containing element position: relative if not already set.
The background-position CSS property sets the initial position for each background image. The position is relative to the position layer set by background-origin .
The background-position property sets the starting position of a background image. Tip: By default, a background-image is placed at the top-left corner of an element, and repeated both vertically and horizontally.
You can easily position an image by using the object-position property. You can also use a bunch of other ways like float-property that will be discussed further in this article. Methods: object-position property: Specify how an image element is positioned with x, y coordinates inside its content box.
background-position: right 30px center;
It works in most browsers. See: http://caniuse.com/#feat=css-background-offsets for full list.
More information: http://www.w3.org/TR/css3-background/#the-background-position
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With