LILLY ROBOT |
You have already learnt about links in HTML. In CSS we are going to learn how to style our links with different colours, so your viewers can understand which sites they have visited.
Links | CSS | Example |
---|---|---|
Unvisited Link - a:link The link has not been clicked on |
a:link{color:red;} | Visit HTML Site |
Visited Link - a:visited When the link is clicked on. The colour changes from red to green |
a:visited{color:green;} | Visit HTML Site |
Hover - a:hover The colour of the link changes from red to blue when the mouse is placed on the link. |
a:hover{color:blue;} |
Visit HTML Site |
Active Link - a:active The colour of the link changes from red to purple when it is activated. |
a:active{color:purple;} |
Visit HTML Site |
Displays
Click hereThe above link colour is red but if you do the following the link colour will change:
If you have several links, on the same web page, to different sites you might want to style the links differently. For example, on this web page the exercises and content links have different styles.
Have a look at the examples below on how you can use the class selector to style your links diffrently.
Displays