title: Why html <A> tag layout offset is different that its parent?
body: <p>This issue started with codedui automation, but it seems it is a pure html issue. Codedui was able to find the control but was highlighting it in a wrong place, and ultimately was clicking at wrong place too. </p>
  
  <p>After digging some ground i found that there was a fontawesome icon in that hyperlink with style <code>float: left</code>. This was causing the hyperlink<code>&lt;a&gt;</code> (not <code>&lt;i&gt;</code> inside the hyperlink) to move few pixels on right side.</p>
  
  <p>Now I will come to HTML part. Below is the sample html structure</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
    &lt;div style="margin:100px;"&gt;
      &lt;a href="#"&gt;
        &lt;i style="float: left;"&gt;hello&lt;/i&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Layout offset of above html tags are:</p>
  
  <pre><code>&lt;Div&gt; X= 108, Y= 100
  &lt;A&gt;   X= 140, Y= 86   &lt;---
  &lt;I&gt;   X= 108, Y= 100
  </code></pre>
  
  <p><strong>Question:</strong> If <code>float: left</code> is set on any child of hyperlink tag then why does the hyperlink moves away from its current position.</p>
  
  <p>If we remove the <code>float: left</code> from  tag then all lines up at 108x100. In actual project <code>&lt;i&gt;</code> is used for fontawesome icon with a <code>float: left</code> on it. Not sure why dev have used float there. But my question remains. Why should it affect <code>&lt;a&gt;</code> position. </p>
  
  <p>Just for info, I checked the layout details in IE9. <img src="https://i.stack.imgur.com/fPjSx.png" alt="enter image description here"></p>