SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Addict laburke's Avatar
    Join Date
    Jan 2005
    Location
    Michigan
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question 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:
    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.

  2. #2
    SitePoint Zealot Gar onn's Avatar
    Join Date
    Feb 2011
    Location
    Belgium
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    put them in a div with ID:"affiliate_div" and then use
    Code CSS:
    #affiliate_div > img{
       border-width:0px !important;
    }

    then all the images within #affiliate_div should have no border

  3. #3
    SitePoint Addict laburke's Avatar
    Join Date
    Jan 2005
    Location
    Michigan
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  4. #4
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    8,897
    Mentioned
    138 Post(s)
    Tagged
    2 Thread(s)
    if you can set a class on the image you could do that as well:

    HTML Code:
    <img class="affiliate" src="..." etc />
    Code css:
    img.affiliate { border: 0; }
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  5. #5
    SitePoint Addict laburke's Avatar
    Join Date
    Jan 2005
    Location
    Michigan
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  6. #6
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    8,897
    Mentioned
    138 Post(s)
    Tagged
    2 Thread(s)
    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.
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  7. #7
    SitePoint Addict laburke's Avatar
    Join Date
    Jan 2005
    Location
    Michigan
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks to ScallioXTX, who solved the riddle.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •