In the previous part of this walkthrough, I made the content appear in columns with floats.
I will now show you how to style the links. With CSS, you can style links by targeting the anchor tag like so:
a { /* your CSS goes here */ }
However, you can also style the 5 specific states of links. The states are: link, visited, focus, hover, active. An easy way to remember them is: Lord Vader's Former Handle, Anakin. Link, Visited, Focus, Hover, Active. Easy.
These states are styled via pseudo selectors. Here's the CSS so you can see what pseudo selectors look like:
a:link { }
a:visited { color:green; }
a:focus { background-color:#ffff99; }
a:hover { background-color:#ffff99; }
a:active { }
As you can see, I have decided to style my links as so:
Because focus and hover have the same styling, I could have combined them as so:
a:focus, a:hover { background-color:#ffff99; }
As long as I maintain the order (L V F H A), the effect is the same. The CSS for this is located in step6.css and can be viewed at step2-3.html. Make sure to hover and tab through the links to see the effect.
We now have a unique webpage design. In the next part I will show some advanced techniques to improve this. Move on to part 6.