title: Set width of a "Position: fixed" div relative to parent div
body: <p>I'm trying to give a div (position: fixed) the width of 100% (relating to it's parent div). But I've got some problems...</p>
  
  <p>EDIT:
  <strong>The first problem is sovled by using inherit, but it still doesn't work. I think the problem is that I'm using multiple divs that take the 100%/inherit width.
  You can find the second problem on the jsfiddle update: <a href="http://jsfiddle.net/4bGqF/7/" rel="noreferrer">http://jsfiddle.net/4bGqF/7/</a></strong></p>
  
  <p>Fox example</p>
  
  <pre><code>#container {
      width: 800px;
  }
  
  #fixed {
      position: fixed;
      width: 100%;
  }
  </code></pre>
  
  <p>and the html</p>
  
  <pre><code>&lt;div id="container"&gt;
      &lt;div id="fixed"&gt;Sitename&lt;/div&gt;
      &lt;p&gt;
          blaat
      &lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Or you can try it out: <a href="http://jsfiddle.net/4bGqF/" rel="noreferrer">http://jsfiddle.net/4bGqF/</a></p>
  
  <p>The problems seems to be that the <strong>fixed element is always taking the width of the window/document</strong>. Does anyone know how the fix this?</p>
  
  <p>I can't give my fixed element a fixed with, because I'm using the jScrollPane plugin. It depends on the content whether there's a scrollbar or not.</p>
  
  <p>Thanks a lot!</p>
  
  <p>PS: The text of the 2 divs are on top of each other. This is just an example so that doesn't really matter.</p>