Toggle HTML CSS JavaScript

HTML Links - Different Colors


An HTML link is displayed in a different color depending on whether it has been visited, unvisited or active.



Example:

<style>
a:link, a:visited {
    background-color: #f44336;
    color: white;
    padding: 15px 25px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}
a:hover, a:active {
    background-color: red;
}
</style>