title: Absolute positioning and its parent element
body: <p>I've always heard that when you use absolute positioning that the element you want to act as its parent needs to have a <code>position</code> of <code>relative</code>.</p>
  
  <p>I was trying to build a CSS dropdown menu and I was struggling to get the dropdown menu items stretch beyond the width of the main menu item when I had its parent element I wanted it to use set as <code>relative</code>; the text in the drop down menu items would just wrap.</p>
  
  <p>So I looked around at other example menus to see how they did it and one I found wasn't even using any parent elements with a <code>position</code> of <code>relative</code> even though they were using absolute positioning like I was.</p>
  
  <p>That example is here: <a href="http://purecssmenu.com/" rel="noreferrer">http://purecssmenu.com/</a></p>
  
  <p>So I tried removing my <code>relative</code> positioning and bingo - my problem went away. However now I am using absolute positioning with none of it's parents using <code>relative</code> positioning, they are all set to <code>static</code>.</p>
  
  <p>So I'm wondering how that makes sense - with no <code>relative</code> parents wouldn't it fall back to the browser window?</p>
  
  <p>If need be, here is my HTML:</p>
  
  <pre><code>    &lt;div class="navWrapper"&gt;
          &lt;div class="left"&gt;&lt;/div&gt;
          &lt;div class="nav"&gt;
              &lt;ul&gt;
                  &lt;li class="home"&gt;&lt;a href="/"&gt;Home&lt;/a&gt;&lt;/li&gt;
                  &lt;li class="spacer"&gt;&lt;/li&gt;
                  &lt;li class="about"&gt;&lt;a href="about_us/"&gt;About Us&lt;/a&gt;&lt;/li&gt;
                  &lt;li class="spacer"&gt;&lt;/li&gt;
                  &lt;li class="trademark"&gt;&lt;a href="freetrademarksearch/"&gt;Free Trademark Search&lt;/a&gt;&lt;/li&gt;
                  &lt;li class="spacer"&gt;&lt;/li&gt;
                  &lt;li class="services"&gt;
                      &lt;a href="services/"&gt;Services&lt;/a&gt;
                      &lt;ul class="sub"&gt;
                          &lt;li&gt;&lt;a href=""&gt;Trademark Search&lt;/a&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;a href=""&gt;Prepare &amp;amp; File Trademark&lt;/a&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;a href=""&gt;Trademark Infringement&lt;/a&gt;&lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/li&gt;
                  &lt;li class="spacer"&gt;&lt;/li&gt;
                  &lt;li class="testimonials"&gt;&lt;a href="testimonials/"&gt;Testimonials&lt;/a&gt;&lt;/li&gt;
                  &lt;li class="spacer"&gt;&lt;/li&gt;
                  &lt;li class="more"&gt;&lt;a href="javascript:void(0);"&gt;More Information&lt;/a&gt;&lt;/li&gt;
                  &lt;li class="spacer"&gt;&lt;/li&gt;
                  &lt;li class="contact"&gt;&lt;a href="contact-us/"&gt;Contact Us&lt;/a&gt;&lt;/li&gt;                 
              &lt;/ul&gt;
              &lt;div class="contentClear"&gt;&lt;/div&gt;
          &lt;/div&gt;
          &lt;!-- Nav Ends --&gt;
          &lt;div class="right"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;!-- Nav Wrapper Ends --&gt;
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>#header .navWrapper {
      width: 1004px;
  }
  
  #header .navWrapper .left {
      float: left;
      width: 4px;
      min-width: 4px;
      height: 47px;
      min-height: 47px;
      background: url('../images/nav-left-bg.png') left top no-repeat;
  }
  
  #header .navWrapper .nav {
      float: left;
      width: 994px;
      border-top: 1px solid #e0d0b4;
      border-left: 1px solid #e0d0b4;
      border-right: 1px solid #e0d0b4;
      border-bottom: 1px solid #e8dcc8;
      background: url('../images/nav-button-bg.png') left top repeat-x;
  }
  
  #header .navWrapper .nav ul {
      margin: 0 1px;
      display: block;
  }
  
  #header .navWrapper .nav li {
      float: left;
      display: block;
      height: 45px;
      font-family: OpenSansBold, Arial;
      font-size: 16px;
      line-height: 2.9;
      text-align: center;
      color: #646464;
  }
  
  #header .navWrapper .nav li.spacer {
      width: 2px;
      min-width: 2px;
      height: 45px;
      min-height: 45px;
      background: url('../images/nav-button-spacer-bg.png') left top no-repeat;
  }
  
  #header .navWrapper .nav li a,
  #header .navWrapper .nav li a:visited
  {
      display: block;
      height: 45px;
      padding: 0 20px;
      color: #646464;
      text-decoration: none;
  }
  
  #header .navWrapper .nav li a:hover,
  #header .navWrapper .nav li a:active,
  #header .navWrapper .nav li a:focus
  {
      color: #fff;
      background: url('../images/nav-button-bg.png') left bottom repeat-x;
  }
  
  #header .navWrapper .nav li.home {
      max-width: 86px;
      text-indent: -1px;
  }
  
  #header .navWrapper .nav li ul.sub {
      position: absolute;
  }
  
  #header .navWrapper .nav li ul.sub li {
      float: none;
      display: block;
      font-family: OpenSansSemibold, Arial;
      font-size: 14px;
      line-height: 2.3;
      height: auto;
      text-align: center;
      background-color: #f4771d;
      color: #fff;
  }
  
  #header .navWrapper .nav li ul.sub li a,
  #header .navWrapper .nav li ul.sub li a
  {
      color: #fff;
      height: auto;
  }
  
  #header .navWrapper .nav li ul.sub li a:hover,
  #header .navWrapper .nav li ul.sub li a:focus,
  #header .navWrapper .nav li ul.sub li a:active
  {
      background: #d66627;
  }
  
  #header .navWrapper .right {
      float: right;
      width: 4px;
      min-width: 4px;
      height: 47px;
      min-height: 47px;    
      background: url('../images/nav-right-bg.png') left top no-repeat;
  }
  </code></pre>