- Pseudo means "not genuine"
- A selector for which there is no XHTML equivalent
- For common pseudo-class selectors:
- 1. a:link: Changes the appearance of link text for links that have not yet been visited; because you want your unvisited links to stand out, use bright colors for these links
- 2. a:visited: Changes the appearance of link text for links that have been visited; because you don't want your visited links to stand out, use darker colors for these links; it's also common to remove any text decoration (underlining) in visited links
- 3. a:hover: Changes the appearance of link text when the pointer hoves over a link; don't change the point size of the link text; however, it is common to change the color and add a contrasting background color to the link text
- 4. a:active: Changes the appearance of link text when the visitor clicks a link; use a bright color
CSS pseudo-class selectors allow you more variety in choosing the appearance of links and visited links. In addition, CSS can add "mouse over" (rollover) effects so that when the user passes the mouse pointer over a link, the link text can appear, for example, in a different color, background color, or font.
- The order of the pseudo-classes does matter:
- 1. The a:hover must be placed after the a:link and a:visited rules; otherwise, specificity will hide the color property of the a:hover rule
- 2. The a:active must be placed after a:hover; otherwise, the active color will appear when the user clicks a link or hovers the pointer over the link
- 3. To help you remember the correct order of styling pseudo-class selectors, use a mnemonic such as "Little Victor hates apples."
- In the Firefox browser, the a:visited pseudo-class selector will not work unless the "Remember visited pages for the last_days" text box has a value greater than 0 (You will find this setting in the Options dialog box).
- The a:visited works in Internet Explorer even if the "Days to keep pages in history" setting in the Options dialog box has a value of zero.
- If you are testing visited links and want to refresh the screen in Internet Explorer or Firefox, clear or delete the browsing history in either browser, and then refresh the window.
- The pseudo-class selectors can partially be styled as part of the page properties. However, the only option in the page properties is change the link color.
- You can change the appearance of pseudo-selectors by modifying the code in Split view or Code view or modifying the style.
It's common to change the link colors and remove the underscoring from visited links. However, do not change the point size of the text (it can be distracting) or create overly complex link styles