CSS pseudo class :link – style for unvisited links

CSS :link pseudo-class applies to links that have not yet been visited.

Example – use :link to apply style to unvisited links

This example displays unvisited links in red color. Clicking on a link makes it visited and style applied by :link is removed. Note that you will have to clear your browser cache to make this example work second time.

<p>Clicking on these link will remove any :link style as it applies to unvisited links</p>
<style type="text/css">
a:link {
 color: red;
<a href="#link1">link1</a> 
<a href="#link2">link2</a>



Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit


Click here to write/view comments