title: How to center div element (right: 50% Doesnt work)
body: <p>I'm trying to center a <code>div</code> element, but when I use this:</p>
  
  <pre><code>position: relative;
  float: right;
  right: 50%;
  margin: 0 auto;
  </code></pre>
  
  <p>I get the following:</p>
  
  <p><a href="https://i.stack.imgur.com/73Mzg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/73Mzg.png" alt="enter image description here"></a></p>
  
  <p>It just centers the right edge of the element and everything else goes to left. </p>
  
  <p>Any ideas?</p>