CSS3 background customize is a powerful tool, but it lacks one feature for me. I can set background-position in few ways, but I need some combinations of those. For example, there is a dynamically re-sized div, and I need a right-center oriented image which is 15px from the right border. I can not find any way to handle this.
I could use two fixes, none of them are elegant.
1. I leave a blank 15px area on the picure’s right side.
2. I use this: background-position: 97% 50%
But, in the second case, if the div is re-sized, the calculated right margin will be incorrect.
Or, I use a standard image instead of bg-image, but I try to avoid this.
So, is there any solution?
Thanks!
CSS3 background customize is a powerful tool, but it lacks one feature for me.
Share
CSS3 extends
background-positionto allow for that. For example, you can do:Unfortunately, only Opera currently supports this.
However, the common reason you want that, is that you have a 15px padding. If that’s the case, you can just do:
which is supported by every CSS3 browser.