title: How to make h1 tag center with its actual width
body: <p>I need to make h1 tag center and also need to make a border around it.
  To prevent taking up more width I give <code>display: inline-block</code>  but the tag does not respond to <code>text-align: center</code> then.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>h1 {
    text-align: center;
    border: 1px solid;
    display: inline-block;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
    &lt;h1&gt;This is the Title&lt;/h1&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>