Remove the dotted outline focus on links

Sometimes with site design in mind you need to remove the dotted outline focus box on some links. I do this normally for only a subset of links as the focus box just bugs me in terms of a sites look and feel.

At any rate this can be achieved in your CSS file for most browsers with the following two lines :-

Show Plain Text
CSS code
  1. a:focus, a:active {
  2. outline: none;
  3. -moz-outline: none;
  4. }

Like normal IE is a pain and requires the hidefocus attribute to be set to true :-

Show Plain Text
HTML code
  1. <a href="your link" hideFocus="true">Your Text</a>

I have set these properties on the Show Plain Text links on the code blocks.

On a different topic but I'll list if for reference, to remove the blue border on image links :-

Show Plain Text
CSS code
  1. img {
  2. border-style: none;
  3. }
Filed under: Design  Tags: Css

0 Responses to “Remove the dotted outline focus on links”

Sorry, comments have been closed for this post.
(default) 11 queries took 2 ms
NrQueryErrorAffectedNum. rowsTook (ms)
1DESCRIBE `posts`17171
2DESCRIBE `comments`11111
3DESCRIBE `tags`220
4DESCRIBE `categories`220
5DESCRIBE `posts_tags`220
6DESCRIBE `categories_posts`220
7SELECT `Post`.`id`, `Post`.`url`, `Post`.`title`, `Post`.`icon`, `Post`.`metadesc`, `Post`.`metakeys`, `Post`.`categories`, `Post`.`tease`, `Post`.`body`, `Post`.`private_body`, `Post`.`created`, `Post`.`modified`, `Post`.`status`, `Post`.`allow_comments`, `Post`.`tags`, `Post`.`hitcount`, `Post`.`hitcount_rss` FROM `posts` AS `Post` WHERE `Post`.`url` = 'remove-the-dotted-outline-focus-on-links' LIMIT 1110
8SELECT `Comment`.`id`, `Comment`.`post_id`, `Comment`.`body`, `Comment`.`author`, `Comment`.`url`, `Comment`.`email`, `Comment`.`ip`, `Comment`.`status`, `Comment`.`junk_score`, `Comment`.`created`, `Comment`.`modified` FROM `comments` AS `Comment` WHERE `Comment`.`status` = 2 AND `Comment`.`post_id` = (61) 000
9SELECT `Tag`.`id`, `Tag`.`tag`, `PostsTag`.`post_id`, `PostsTag`.`tag_id` FROM `tags` AS `Tag` JOIN `posts_tags` AS `PostsTag` ON (`PostsTag`.`post_id` = 61 AND `PostsTag`.`tag_id` = `Tag`.`id`) 110
10SELECT `Category`.`id`, `Category`.`category`, `CategoriesPost`.`post_id`, `CategoriesPost`.`category_id` FROM `categories` AS `Category` JOIN `categories_posts` AS `CategoriesPost` ON (`CategoriesPost`.`post_id` = 61 AND `CategoriesPost`.`category_id` = `Category`.`id`) 110
11UPDATE `posts` AS `Post` SET `Post`.`hitcount` = Post.hitcount + 1 WHERE `Post`.`id` = 6110