Removing Dotted Line around Active Links using CSS

CSSWeb DevelopmentFront End Technology

We can remove the default behavior of hyperlinks which is to show a dotted outline around themselves when active or focused by declaring CSS outline property on active/focused links to be none.


a, a:active, a:focus {
   outline: none;


Let’s see how to remove dotted line around active links with an example −

 Live Demo

<!DOCTYPE html>
<title>Remove dotted line around links using css</title>
div {
   color: #000;
   background-image: linear-gradient(135deg, #dc3545 0%, #9599E2 100%);
   text-align: center;
a, a:active, a:focus {
   outline: none;
<h1>HTML Links Demo</h1>
<a href="" target="_blank">Go To Google</a>


Following is the output for the above code −

Before applying the solution

After applying the solution

Updated on 07-Jan-2020 12:35:32