title: Set width of fixed positioned div relative to his parent having max-width
body: <p>Is there any solution without JS?</p>
  
  <p>html</p>
  
  <pre><code>&lt;div class="wrapper"&gt;
     &lt;div class="fix"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>css</p>
  
  <pre><code>.wrapper {
    max-width: 500px;
    border: 1px solid red;
    height: 5500px;
    position: relative;
  }
  
  
  .fix {
    width: inherit;
    height: 20px;
    position:fixed;
    background: black;
  }
  </code></pre>
  
  <p>I cant add any other styles for <code>.wrapper</code> except <code>width: 100%;</code>.
  I try with <code>width: inherit</code> but it doesn't work for me because of I have parent div with only max-width. <a href="https://stackoverflow.com/questions/5873565/position-fixed-relative-to-parent-div">source</a></p>
  
  <p>Here is <a href="http://jsfiddle.net/mx6anLuu/" rel="nofollow noreferrer">JsFiddle Demo</a></p>