HTML: Hiding border of focused elements

When you focus a link or some other focusable HTML element, you’ll get some more or less ugly outline which might not quite be what you want. In Firefox it’s for example a dotted border:

To remove this outline e.g. for all links, simply add this CSS:

a {
  border: 0;
  outline: 0;
}

This won’t work for any element in Internet Explorer. You might have to add some none standard attribute:

<a href="#" hidefocus="true">some link</a>
DeliciousTwitterFacebookLinkedInRedditSlashdotTechnorati FavoritesDiggShare
This entry was posted in CSS, HTML. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">