How to set a different color for visited and unvisited links in Html? How to have link with no underlines using style sheet?
Explanation
Property :
a:visited Many times we want our links to show different colors. We might want our visited links to be shown in red color and font size as 10px. We might want our non-visited links to be shown in green color and font size as 15px. This can be achieved by using internal style sheet coding For this, in the header portion add the style as
We can set the link property for visited links using the tag "a:visited". We can set any property (text, box, font, background properties).
Example:
The below links will give you the result: The first link is some dummy value so it will be treated as a non-visited link. The second link is for the same page("link-styles.php") which is the visited link.
<style> a{color: green; font-size: 15px} a:visited{color: red; font-size: 10px;} </style> <a href="link-styles.php">This is non-visited link</a><br><br> <a href="link-styles.php">This is visited link</a><br>