Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Need help with border issue

    Hi everyone, coding newbie here.

    So I pretty much learnt everything on my own, so I have glaring gaps in knowledge in coding. Anyway, here is what I'm trying to do:

    - I have a CSS code for a hover effect, which works fine.
    - For the site that I want to use it for, I can't use <div> or <style> tags.

    Here is my coding (with image urls and site urls taken out):

    PHP Code:
    CSS

    .link  {
    margin-top:20px;
    margin-left:15px;
    width:243px;
    height:136px;
    background:url(img1.jpg);
    background-repeat:no-repeat;
    }



    .
    link:hover {
    width:243px;
    height:136px;
    background:url(img2.jpg);
    background-repeat:no-repeat;
    }

    HTML
    <a href='url/' target='_blank'><img style='position:relative; left:-350px;top:-10px;border:0;' class='link'></a
    The problem
    The css works fine, the only problem is that now, I'm stuck with a small grey border around my image that I can't seem to shake off. Since it's an area that is supposed to be filled with
    PHP Code:
    <img src="url"
    (i suppose), it has that border. I don't really know if I'm being clear, but I hope that I've explained it ok. Again, coding noob, thus I need the help. Any advice would be MUCH appreciated!

    Thanks!

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Add
    Code:
    a img{border:none;}
    into your CSS
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Tags for this Thread

    Posting Permissions

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