title: Exclude upper parent when applying css
body: <p>My problem is that I've got to apply some CSS styles to every image which parent is a link, except those links that are inside a <code>&lt;li&gt;</code> element. Here is my code:</p>
  
  <pre><code>$("img").parent("a").css({"padding": "0", "border": "0 none", "background-color": "transparent"})
  </code></pre>
  
  <p>It works fine with images posted in the main page, but it ruins my top menu too cause it has an image inside a link (for language selection).</p>
  
  <p>Is there a way to apply the styles to every linked image, <strong>except</strong> those which parent is a <code>&lt;li&gt;</code> element? Thanks.</p>