title: How does relative and absolute positioning work with embedded divs?
body: <p>I need to position <code>div</code>s within <code>div</code>s, and I am getting crazy. I've read many docs on the net, but I am still not clear about behavior of <code>relative</code> and <code>absolute</code> positioning when <code>div</code>s are embedded.</p>
  
  <p>Someone <a href="http://www.codingforums.com/showthread.php?t=155733" rel="nofollow">came up</a> with the following:</p>
  
  <blockquote>
    <p>The best way I've found to understand absolute positioning is that
    position:relative looks "downstream" to child elements and
    position:absolute looks "upstream" to parent elements. That is, when
    you tell an HTML element to be absolutely positioned, it's going to
    look "up" to its parent elements until it finds one that is set to
    position:relative, and will position itself based on that. If it
    doesn't find one, it will position itself with respect to the 
    by default.</p>
  </blockquote>
  
  <p>Is this correct for all browsers? Is this a complete explanation?</p>
  
  <p>My issue is that I have several <code>div</code>s embedded in several <code>div</code>s. I need to position some child <code>div</code> within a parent <code>div</code>, with high precision (for example top 33, left 9). The parent <code>div</code> can be embedded in a grand-parent <code>div</code>, with high precision too, etc...</p>
  
  <p>How does one solve this issue for all browsers? Should I create a super <code>relative</code> parent <code>div</code> from which the whole hierarchy of <code>div</code> should be positioned as <code>absolute</code>?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>From current answers, I have an extra question: does one have to explicitly declare a <code>relative</code> or <code>absolute</code> position in each <code>div</code> to make positioning work? In other words, if a div does not have a <code>relative</code> or <code>absolute</code> position, it is not taken into account when computing positions?</p>
  
  <p><strong>FOR THE RECORDS</strong></p>
  
  <p>The answer to the above question is yes.</p>