How to overrule CSS that applies to tracking pixel

I’ve got a Commission Junction affiliate link on my page and it includes a tracking pixel for tracking impressions. The code in the link itself shows border=0 but the CSS for the rest of the site is overruling it and putting a 2-pixel border on with this code:

img {
    border: 2px solid #000000;}

How can I get rid of that without changing the other images? I can wrap a div around it but I’d like to not have to mess with the affiliate links every time I put one in.

put them in a div with ID:“affiliate_div” and then use

#affiliate_div > img{
   border-width:0px !important;
}

then all the images within #affiliate_div should have no border

Thanks for your reply. There is no way to do this, then, without having to wrap a div around each affiliate link I put on the site?

if you can set a class on the image you could do that as well:

<img class="affiliate" src="..." etc />
img.affiliate { border: 0; }

Thank you, Scallio; that seems a tad simpler. It’s not working for some reason, though. I’ve added the class tag in the HTML and put the CSS in the custom code box of my theme. Why must CSS always pick a fight with me? :slight_smile:

Could you post the URL of your website so we can have a look?

If you don’t want to post it in public feel free to PM me.

Thanks to ScallioXTX, who solved the riddle. :slight_smile: