title: How to center a tooltip horizontally on top of a link
body: <p>I'm trying to get a tooltip box to be inserted on top and centered of an a tag. I have this working for small Text, but I can't seem to get it to center on large text.</p>
  
  <p>I understand it has to do with positioning the box and the arrow but I can't seem to find the right combination to get the arrow centered under the box and the box centered above the a tag.</p>
  
  <p>I'm hoping to accomplish this with just CSS alone.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div&gt; 
      &lt;a class="tooltip" href="#" title="tooltip"&gt;
          &lt;span&gt;Text&lt;/span&gt;    
      &lt;/a&gt;
  
  &lt;/div&gt;
  &lt;div&gt; &lt;a class="tooltip" href="#" title="tooltip"&gt;
          &lt;span&gt;TextTextText&lt;/span&gt;    
      &lt;/a&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>CSS:</p>
  
  <pre class="lang-css prettyprint-override"><code>div {
      padding: 150px;
      display: inline-block;
      background-color: red;
  }
  .tooltip{
      display: inline;
      position: relative;
  }
  .tooltip:hover:after{
      background: #333;
      background: rgba(0,0,0,.8);
      border-radius: 5px;
      bottom: 26px;
      color: #fff;
      content: attr(title);
      padding: 10px;
      left: -50%;
      position: absolute;
      z-index: 98;
  }
  .tooltip:hover:before{
      border: solid;
      border-color: #333 transparent;
      border-width: 6px 6px 0 6px;
      bottom: 20px;
      content: "";
      left: 30%;
      position: absolute;
      z-index: 99;
  }
  </code></pre>
  
  <p><a href="http://jsfiddle.net/anx26/2/" rel="noreferrer">And here is the fiddle</a>.</p>
  
  <p>I really would appreciate any help I can get.</p>