Skip to content

Instantly share code, notes, and snippets.

@TangChr
Last active November 21, 2015 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TangChr/9560fc9f5ad1b13281c7 to your computer and use it in GitHub Desktop.
Save TangChr/9560fc9f5ad1b13281c7 to your computer and use it in GitHub Desktop.
CSS: Link with different color for underline
<!DOCTYPE html>
<html>
<head>
<title>Link Color</title>
</head>
<style>
body {
background: #2c3e50;
font-family: Arial, Verdana, sans-serif;
}
h1 {
font-size: 50px;
}
a,
a:active,
a:visited {
color: #808080;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a span {
color: #fff;
}
</style>
</head>
<body>
<h1>
<a href="#">
<span>This is a link</span>
</a>
</h1>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment