I am trying to edit the link states of a CSS class. I see from the W3 schools example, that if I want to change all links, I can form my website like so:
<!DOCTYPE html>
<html>
<head>
<style>
a:link, a:visited {
background-color: white;
color: black;
border: 2px solid green;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
}
a:hover, a:active {
background-color: green;
color: white;
}
</style>
</head>
<body>
<h2>Link Button</h2>
<a href="default.asp" target="_blank">This is a link</a>
</body>
</html>
However, I cannot figure out how to modify only some links in this way. I have tried a number of previous suggestions but nothing worked. Here is one example:
<!DOCTYPE html>
<html>
<head>
<style>
.foo a:link, a:visited {
background-color: white;
color: black;
border: 2px solid green;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
}
.foo a:hover, a:active {
background-color: green;
color: white;
}
</style>
</head>
<body>
<h2>Link Button</h2>
<a class="foo" href="default.asp" target="_blank">This is a button link</a>
<a href="default.asp" target="_blank">This is another link</a>
</body>
</html>
Any help would be appreciated. Thanks!