How do I get rid of this border?

Discussion in 'Web Design and Development' started by theNIC, Nov 14, 2009.

  1. theNIC macrumors member

    Joined:
    Apr 8, 2009
    #1
    Sorry for the long title, didn't really know what to name it.

    Anyways, I'm helping out my friend with this script, and I was wondering how do I get rid of this border on the image? (No it's not border="0")

    Here's a screenshot and my source:

    Ok for some reason my image isn't showing up, but here's a link to the screenshot: http://tinypic.com/r/vd2zh1/4

    http://thecurseofcurves.com/ad.js

    I know my padding on my links are causing it (in my CSS), but there has to be an easy way around this. Any help is greatly appreciated.
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Screen shot isn't really enough. Need to see HTML/CSS.
     
  3. theNIC thread starter macrumors member

    Joined:
    Apr 8, 2009
    #3
  4. nuxx macrumors member

    nuxx

    Joined:
    Jun 5, 2007
    Location:
    Tokyo
    #4
    That's not strictly a border. It's the formatting on the parent <a> tag.

    I'd suggest you change the CSS for the a selector:

    Code:
    a {
        color: #FFF;
        text-decoration: none;
    }
    Then add

    Code:
    a p {
        display: inline;
        background: #CCC;
        padding: 2px;
    }
    Then in the HTML, instead of

    HTML:
    <a href="http://thecurseofcurves.com/site/advertising.php">
        Advertise Here
    </a>
    
    enclose the text in a <p> tag

    HTML:
    <a href="http://thecurseofcurves.com/site/advertising.php">
        <p>Advertise Here</p>
    </a>
    Now you won't see the grey box behind the image as it's parent tag is <a> and not <p>.
     
  5. theNIC thread starter macrumors member

    Joined:
    Apr 8, 2009
    #5
    Thanks, it worked but is there any way I can keep my padding on my regular links, or no?
     
  6. nuxx macrumors member

    nuxx

    Joined:
    Jun 5, 2007
    Location:
    Tokyo
    #6
    Add

    Code:
    p a {
        padding: 2px;
    }
     
  7. theNIC thread starter macrumors member

    Joined:
    Apr 8, 2009

Share This Page