title: How to Display a DIV with 'fixed' and 'inline-block' Added to its CSS Properties
body: <p>I want to be able to display a <strong>DIV</strong> in a <code>fixed</code> position and have its <code>width</code> fit to content but each time I add <code>position: fixed;</code>, the div gets computed to <code>display: block;</code> and the div becomes full length.</p>
  
  <p><strong>HTML</strong>:</p>
  
  <pre><code>&lt;div class='veil'&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>CSS</strong>:</p>
  
  <pre><code>.veil{
      display: inline-block;
      position: fixed;
      top: 34%;
      left: 0;
      right: 0;
      margin: 0 auto;
      background-color: lavender;
  }
  </code></pre>