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 8 of 8
  1. #1
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts

    remove underline from link

    i have picture with link and i couldnot remove underline (or border) from it

    my codes followings

    Code:
    <style type="text/css">
    <!--
     a { text-decoration: none; }
    -->
    </style> 
    
    
    <a href="http://www.goolge.com" title="google" target="_blank"><img src="images/ico.png" /></a>

  • #2
    Regular Coder
    Join Date
    May 2008
    Location
    Oxford, UK
    Posts
    422
    Thanks
    14
    Thanked 27 Times in 27 Posts
    if you want to remove the b order from all linked images then add this to your styles...


    Code:
    img {border:0px;}
    If you only want it from away from that image then use...

    Code:
    <img style="border:0px" src="images/ico.png" />

  • #3
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by brazenskies View Post
    if you want to remove the b order from all linked images then add this to your styles...


    Code:
    img {border:0px;}
    If you only want it from away from that image then use...

    Code:
    <img style="border:0px" src="images/ico.png" />
    0 have no units,
    use border: 0; or border: none;
    I don't know if is about underline because op text-decoration: none, already solve this problem so I guess is about outline:

    http://www.htmldog.com/reference/cssproperties/outline/

    probably outline-style: none; will solve the problem.

    regards

  • #4
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Quote Originally Posted by oesxyl View Post
    0 have no units,
    brazenskies' code was perfectly adequate.

    For 0 values, units are optional. You can use them if you wish. They aren't going to do any harm and won't make any functional difference.

    use border: 0; or border: none;
    Heck, belt 'n' braces… border: 0 none; is perfectly valid.

    I don't know if is about underline because op text-decoration: none, already solve this problem so I guess is about outline:

    http://www.htmldog.com/reference/cssproperties/outline/

    probably outline-style: none; will solve the problem.
    …and create another*.

    Bear in mind that the outline is a property of the anchor, not the img within the anchor, so it would need to be applied to the anchor, were it wanted gone.
    * Bear in mind the accessibility issus associated with removing the outline (and not replacing it with some other, effective means of denoting focus).

    Fwiw, as you appear to like to drop optional bits, outline: none; should do the same job as outline-style: none;;


    As you most likely know, image links adopt a blue border which text-decoration: none; will not remove. It is most likely that blue border which the OP is speaking of.

    As said, brazenskies' code will do the job.

  • Users who have thanked Bill Posters for this post:

    BabyJack (11-02-2008)

  • #5
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by Bill Posters View Post
    As you most likely know, image links adopt a blue border which text-decoration: none; will not remove. It is most likely that blue border which the OP is speaking of.
    nobody contest brazenskies solution, read op and my post again.

    regards

  • #6
    Regular Coder BabyJack's Avatar
    Join Date
    Apr 2008
    Location
    Somewhere.
    Posts
    602
    Thanks
    43
    Thanked 6 Times in 6 Posts
    Just to direct you into the right direction, and to conclude, you have an image with a purple border around it.
    You need the border: none; code.
    Enlightenment in Coding
    Validate before Posting | Google is your friend for PC Problems | Make sure you have a doctype

  • #7
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Quote Originally Posted by oesxyl View Post
    nobody contest brazenskies solution, read op and my post again.
    Read it perfectly well the first time, ta.

    Seems clear to me that you contested it on two points, his use of units (whereby you assert that 0 has no units [as opposed to pointing out that units are optional for 0 values], suggesting you felt there was something wrong with brazenskies post) and whether that was actually the solution or not, seemingly unaware that the text-decoration property of anchors translates into the border property with anchor images.

    No biggie either way. Just a pedantic observation.


    Fwiw,…
    Code:
    a img { border: 0 none; }
    …is the optimal solution, imo.
    Last edited by Bill Posters; 11-02-2008 at 11:20 AM.

  • #8
    Regular Coder
    Join Date
    May 2008
    Location
    Oxford, UK
    Posts
    422
    Thanks
    14
    Thanked 27 Times in 27 Posts
    wow, I think I'll just stick to the asp forum from now on!


  •  

    Posting Permissions

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