hyperlinkcode.com

How To Make Dashed Underline Hyperlink Hover With Different Colors

Dashed Underline Hover Demo

Internal StyleSheet

Add the following code into the <head> section of your HTML document.

CSS Code:

<style type="text/css" media="screen" />
a {
text-decoration: none;
}
a:link {
color: #0000FF;
border-bottom: 1px solid #0000FF;
}
a:visited {
color: #0000FF;
border-bottom: 1px solid #C0C0C0;
}
a:active {
color: #FF0000;
border-bottom: 1px dashed #FF0000;
}
a:hover {
color: #000000;
border-bottom: 2px dashed #DD0000;
}
</style>

External StyleSheet

If your website has more than one page, it is a good idea to use an external stylesheet so that you can make site-wide changes quickly and easily. Editing only the external stylesheet instead of each individual page will save you lots of time. If you are not sure how this works, there is a demo template below which can be downloaded.

Add the following code to your external stylesheet.

CSS Code:

a {
text-decoration: none;
}
a:link {
color: #0000FF;
border-bottom: 1px solid #0000FF;
}
a:visited {
color: #0000FF;
border-bottom: 1px solid #C0C0C0;
}
a:active {
color: #FF0000;
border-bottom: 1px dashed #FF0000;
}
a:hover {
color: #000000;
border-bottom: 2px dashed #DD0000;
}

Free Demo Webpage and Stylesheet

Like

More HTML Hyperlink Codes