title: Setting Breakpoints to respond to screen size using CSS @media
body: <p>I'm setting breakpoints in css using '@media only screen and (max-width: 500px)'. </p>
  
  <p>When I set it to change colour upon reaching the breakpoint it works:</p>
  
  <pre><code>@media only screen and (max-width: 500px) {#container{color:black;}}
  </code></pre>
  
  <p>the container div does go black when I resize the browser, however when I set the breakpoint to change the margin of the div the breakpoint is not triggered. </p>
  
  <p>So when I set the query to:</p>
  
  <pre><code>@media only screen and (max-width: 500px) {#container{margin-left: 0px;}}
  </code></pre>
  
  <p>nothing changes when the screen is resized in exactly the same way as when I resized when testing for colour change.</p>
  
  <p>the main css file sets #container at margin-left; 18% and when this is changed manually to 0px it does shift the document all the way to the left of the viewport  </p>
  
  <p>I've tried various different styles and html elements but colour changes seem to be very reliable, they work in pretty much any combination, but resizing divs or repositioning does not seem to work at all. Why might this be?</p>
  
  <p>Answer:</p>
  
  <p>I was putting my @media query at the head of my css file , when I moved it to the foot of the css file it now resized. It leaves the question though, why did it change the colour at the head of the file but not resize?  </p>