H152 - Review Questions Week 3
- What is the "correct" (suggested) order for the four link-related
pseudo-classes- and why is that order suggested?a:link
a:visited
a:focus
a:hover
a:active
This order is suggested because of the cascade. Since these items all have the same specificity (0, 0, 1, 1), the last item in the list will take precedence. So, one should put the most generic action before the more specific ones.:linkand:visitedorder doesn't really matter, since they're mutually exclusive, but they must go first, otherwise, their colors will override the more specific pseudo-classes.:focusand:hoverare really the same thing too (just depending on your access methods (keyboard or mouse), so these could go in any order either.:activeshould be last, since it's the last action that a user is going to perform on a link.
- When working with images as links, how could you make the images look and act like physical buttons - in their normal state and when hovered?
You can use borders and changes in the background color of the element that respond to hover (and even active) events. You can also change the image itself (darken or lighten) to respond to hover or active events.
- Write and show us a working demonstration of #2 (images that look and act like buttons, especially when hovered) using CSS in an HTML (or XHTML) document
