title: How to make exceptions to CSS rules?
body: <p>I have a CSS rule that tells all links to have a blue background color and a white text color. However, if I have an image with a link, a's rule gives them a little blue underline from the background color. I hope that makes sense.</p>
  
  <p>Long story short, I would like to tell the a attribute to apply to everything <em>except</em> img elements. Here is my existing CSS code.</p>
  
  <pre><code>a {
    background-color:#0078D7;
    color:white;
  }
  </code></pre>
  
  <p>I have already tried adding ":not(img)", but it didn't change anything. That code is right here.</p>
  
  <pre><code>a:not(img) {
    background-color:#0078D7;
    color:white;
  }
  </code></pre>
  
  <p>Any help is appreciated.</p>
  
  <p><strong>Update:</strong> Here is a snippit of my existing HTML. When the image is clicked, it sends the user to the full view of the image, as intended.</p>
  
  <pre><code>&lt;a href="../images/infobox.png"&gt;&lt;img src="../images/infobox.png" width="300px"&gt;&lt;/a&gt;
  </code></pre>