SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Non-Member
    Join Date
    Nov 2013
    Location
    USA
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to remove the border from a link

    How can I make my link not have this ugly border?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    7 Thread(s)
    Links normally don't have a border, as such, but they do have a default underline. Post a code sample if you can, or a link, and we'll show you what to do.

  3. #3
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,578
    Mentioned
    62 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by davidhodges View Post
    How can I make my link not have this ugly border?
    Try this in your stylesheet.css
    HTML Code:
    a { outline: 0; border:0 }
     

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,604
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    If youi hide the outline then those without a mouse will not know which link has the focus.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    7 Thread(s)
    Quote Originally Posted by felgall View Post
    If youi hide the outline then those without a mouse will not know which link has the focus.
    Indeed. If it's focus outline the OP is asking about, the outline should be replaced by something more pleasing on focus. E.g.

    Code:
    a:focus {outline: none; color: white; background: black;}
    OK, not very pretty styling, but hopefully gets the idea across.

  6. #6
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,804
    Mentioned
    158 Post(s)
    Tagged
    4 Thread(s)
    If you are talking about images in IE that get a blue border when they are surrounded by an anchor then do this.

    Code:
    a img{border:none}


Tags for this Thread

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
  •