title: How to center all elements in html?
body: <p>First I have checked and this is NOT a duplicate. The conditions are totally different than other questions here.
  Please read my whole post before making an answer.</p>
  
  <p>I have a ASP.NET page with unknown width and height size and I want to center all elements in it. No matter if it's inline or block.</p>
  
  <p>The <code>&lt;center&gt;</code> tag does what need but it's obsolete.<br>
  The <code>text-align:center;</code> does not work in all conditions. [inline]<br>
  The <code>margin:auto;</code> does not work in all conditions. [block]  </p>
  
  <p>What already works for all web browsers is the following piece of code :</p>
  
  <pre><code>&lt;div style="float: left; position: relative; left: 50%;"&gt;
      &lt;div style="float: left; position: relative; left: -50%;"&gt;
         my elements here
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This piece of code works in all conditions but it causes Rad Telerik Ajax popups elements to have unknown popup position which usually appear outside page.</p>
  
  <p>So what is <strong>EXACTLY equivalent</strong> to <strong><code>&lt;center&gt;</code></strong> tag which works for all browsers ?<br>
  <strong>Please don't post current solutions which I have mentioned here !</strong></p>