title: How to center a child element in CSS, even if it is larger than the parent?
body: <p>I would like to create a css class so a div can be placed in the center of its parent. The code I am using is:</p>
  
  <pre><code>.centered {
      position: absolute;
      margin: auto;
  
      bottom: 0px;
      left: 0px;
      top: 0px;
      right: 0px;
  }
  </code></pre>
  
  <p>It works if the parent is larger than the child element, or has the same size: 
  <a href="https://jsfiddle.net/cy8dn1km/">https://jsfiddle.net/cy8dn1km/</a></p>
  
  <p>But if the child is larger, then its center is not positioned at the center of its parent. Instead their left borders will be at the same place, and the child element will be extended only to right:</p>
  
  <p><a href="https://jsfiddle.net/797L7nce/">https://jsfiddle.net/797L7nce/</a></p>
  
  <p>Something is wrong with the horizontal centering.</p>
  
  <p>How is it possible to fix it using CSS only (<strong>without using CSS 2D/3D transformations</strong>), without adding new container elements?</p>