title: Original stylesheet settings ignored when inline styles are removed with jquery
body: <p>I have a stylesheet which has some styles set.</p>
  
  <p>One of the styles has <strong>position</strong> set to 'fixed' - but only for certain combinations.</p>
  
  <p>So, for instance:</p>
  
  <pre><code>.mystyle.blue {
      position: fixed;
  }  
  </code></pre>
  
  <p>So, <code>.blue</code> is fixed, but plain <code>.mystyle</code> doesn't receive the same styling by itself.</p>
  
  <p>I also have some jQuery stuff, which adds and removes inline styles. So, under certain conditions, it might add <code>position: fixed</code> to all <code>.mystyle</code> variants.</p>
  
  <p>This is simply done using:</p>
  
  <p><code>$(".mystyle").css("position", "fixed")</code> to add;</p>
  
  <p>and <code>$(".mystyle").removeAttr("style");</code> to remove.</p>
  
  <p>However, once removed, the underlying stylesheet settings are then ignored. So, where I still expect <code>.mystyle.blue</code> to honour <code>position: fixed</code>, it doesn't.</p>
  
  <p>Any idea as to a workaround?</p>
  
  <p>UPDATE</p>
  
  <p>I now know whats happening, and have a fix, but it's not what I expected should happen.</p>
  
  <p>When setting <code>position: fixed</code> using jQuery, I also set a <strong>top position</strong>. This is a negative - <code>-64px</code> (although in reality, it's set dynamically). Obviously, both are removed at the same time.</p>
  
  <p>The stylesheet code is this:</p>
  
  <pre><code>position: fixed;
  top: 0;
  </code></pre>
  
  <p>Which I thought would take effect again once the inline style styles were removed - one does, one doesn't.</p>
  
  <p>The negative top position doesn't seem revert to 0. This could just be my poor understanding. The position does revert to default.</p>
  
  <p>If I add an important tag to <code>top: 0!important</code>, it does work.</p>