title: Div with a fieldset aligned to the right
body: <p>I have a little bit of problem, that I can't seem to quite figure out on my own.</p>
  
  <p>How can I have a 100% width container div that has a fieldset and input box aligned to the right, it seems that my current result is that the groupbox overrides my desired div width and thus stretches it 100% in the pic:
  <img src="https://i.stack.imgur.com/YTTk4.png" alt="enter image description here"></p>
  
  <p>This is my desired result:
  <img src="https://i.stack.imgur.com/QsqSb.png" alt="enter image description here"></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  
  &lt;head&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;div style="width: 100%;"&gt;
  
      &lt;div style="width: auto; text-align: right;"&gt;
  
          &lt;fieldset style="padding: 5px; border: 1px solid rgb(128,128,128);"&gt;
              &lt;legend style="color: rgb(11,63,113); font-weight: bold; font-size: 11pt;"&gt;File Number&lt;/legend&gt;
              &lt;input type="text" id="fileno" style="background: white url(images/glass.png) left no-repeat; padding-left: 19px;" onkeydown="handleKeyDown(event,this)"&gt;
          &lt;/fieldset&gt;
  
      &lt;/div&gt;
  
  
  &lt;/div&gt;  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>