Removing Dotted Outline

a {
   outline: 0;
}

Be careful removing outline styles from links, as they are a usability feature. If you do, make sure to define clear focus styles.

If your problem is that the dotted outlines travel all the way to the left or right of the screen because they are floated, try setting the overflow to hidden.

Comments

  1. User Avatar
    elandy2009
    Permalink to comment#

    A note: The “outline” CSS property doesn’t work in IE6 and IE7.

  2. User Avatar
    Chris
    Permalink to comment#

    This works.

    a {
    outline-style: none;
    }

  3. User Avatar
    Miguel Mendez
    Permalink to comment#

    *:focus { outline: 0; }

  4. User Avatar
    Court Kizer

    Outline: 0 none; <– Use this for perfect outline kill, every…single…time

  5. User Avatar
    Karl Groves

    It is important to remember that if you remove this outline, you should replace it with something else. I recommend using both the :focus and :hover pseudo-classes as a means of providing this important feedback to both mouse and keyboard-only users.

Submit a Comment

Posting Code

You may write comments in Markdown. This makes code easy to post, as you can write inline code like `<div>this</div>` or multiline blocks of code in triple backtick fences (```) with double new lines before and after.

Code of Conduct

Absolutely anyone is welcome to submit a comment here. But not all comments will be posted. Think of it like writing a letter to the editor. All submitted comments will be read, but not all published. Published comments will be on-topic, helpful, and further the discussion or debate.

Want to tell us something privately?

Feel free to use our contact form. That's a great place to let us know about typos or anything off-topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag