TimKeesling.com
CSS Week 3 Quiz
- What is the "correct" (suggested) order for the four link-related pseudo-classes - and why is that order suggested?
-
a:link {color: blue;}
a:active {color: red;}
a:hover {color: magenta;}
a:visited {color: purple;}
- All of them can apply to a hyperlink, and in some cases, more than one will apply. For example, an unvisited link can be hovered and active at the same time as it's an unvisited link. Since three of the above rules apply to the hyperlink, and the selectors all have the same specificity, then the last one listed wins. So then the "active" style will never appear, because it will always be overridden by the "hover" style. Now if a hyperlink has been visited, it will always and forever be purple, because its "visited" style beats out any other state, including "active" and "hover". The first two can be in either order, actually, because a link can't be both visited and unvisited at the same time.
- 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?
- By creating different color and border effects such as "outset" and "inset" so as when the link is hovered over it will appear as if it has changed states.
- 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
-