title: Move div with fixed position if window size changes
body: <p>How can i do the following:
  I need a div to change it's position when the page is opened on a narrow screen or browser window size is changed.
  The fixed div should stay on the same vertical position when the page is scrolled up or down, but i also need it to be lets say 10px away from the largest div(a container for smaller divs, see the picture please). Now when i resize the window the fixed div comes over the div to the right. </p>
  
  <p>So the question is how can i make this fixed div stay on the same position when scrolling the page vertically and make it always be 10px away from the right div? Css class for fixed is:</p>
  
  <pre><code>.fixed{
      width:40px;
      height:40px;
      position:fixed;
      bottom:100px;
      left:100px;
      text-indent:-9999px;
  }
  </code></pre>
  
  <p>In fact i'm trying to implement a "back to top" button, so the fixed div is this button and the largest div is page's content.</p>
  
  <p>Here is what i have now:</p>
  
  <p><img src="https://i.stack.imgur.com/UhSjp.jpg" alt="enter image description here"></p>