title: Place background image 1em from the right?
body: <p>As far as I can tell, it is not possible to place a CSS background image 1em from the right border of any block, neither is it possible to place a image 1em from the bottom.</p>
  
  <p>The following code places the background image 1em from the left and 2em from the top.</p>
  
  <pre><code>&lt;div class="foo" style="background: url('bar.png') no-repeat 1em 2em"&gt;
    Some text here
  &lt;/div&gt;
  </code></pre>
  
  <p>Is there any way in CSS to specify that the background image should be "this far from the right edge" if the size of the box is dynamic and assuming that you cannot change the HTML?</p>
  
  <p>(Percentages won't work, since the box can change size)</p>
  
  <p>If this is not possible, what is the smallest amount of change you need to make to the HTML?</p>
  
  <p>This is the workaround I came up with:</p>
  
  <pre><code>&lt;style&gt;
  div.background
  {
    float: right; 
    background: url('bar.png') no-repeat top left; 
    margin-right: 1em; 
    width: 16px; 
    height: 16px;
  }
  &lt;/style&gt;
  &lt;div class="foo"&gt;
    &lt;div class="background" style=""&gt;&amp;nbsp;&lt;/div&gt;
    Some text here
  &lt;/div&gt;
  </code></pre>