Without using percentages, is it possible to position a background image 2px from the top and 2px from the right of an element?
A:
This is possible in CSS3, http://www.css3.info/preview/background-origin-and-background-clip/, prior to that you have to use nested elements.
<div style="padding:2px">
<div style="background.....">
<p>content...</p>
</div>
</div>
Jonathan
2010-04-21 05:04:35
+1
A:
AFAIK there isn't an easy way to do this with CSS. If the element width is fixed, position the image using a left offset. Otherwise add 2px transparency to the image and set it to top-right.
Jeffery To
2010-04-21 06:26:38
A:
Change your image and add 2px of whitespace to the top and right of it. You should find that there are no cross browser compatibility issues!
Finbarr
2010-04-21 07:15:38
As long as you don't use Alpha transparency that is!
Finbarr
2010-04-21 07:18:56