One of the most common uses of CSS is to change the way links are displayed in the browser. Want your links to only be underlined when the cursor is over them? Want the background or text color to change when a visitor clicks? Or maybe you just want something other than your visitor's default colors? That's all CSS, and Dreamweaver can handle that. As covered in Chapter 5, you'll need to know if your site is going to use internal or external styles.
1. | Click on the New CSS Rule button at the bottom of the CSS panel . The New CSS Rule dialog will appear. |
2. | If you want to set a style that will apply to all links (whatever their state), or to set the default appearance for links, choose "Tag (redefines the look of a specific tag)" for the Selector Type, and for Selector, choose a . or For the Selector Type, choose "Advanced (IDs, pseudo-class selectors)," and for Selector, choose any option from the popup menu: a:link , a:visited , a:hover , or a:active ( Figure 7.9 ). -
a:link is the default state of the link, seen when none of the other states are in use. -
a:visited is how the link will appear after the link has been clicked on and the linked page loaded. -
a:hover is how the link will appear while the visitor's cursor is over the link. -
a:active is how the link will appear while the visitor is clicking that particular link. |
3. | For Define in, there are at least two options: New Style Sheet File or This document only. If the current document links to any style sheets, their names are included in the pop-up menu. Choose whichever is appropriate for this site, and click OK. |
4. | If you chose to create a new style sheet, you'll see the Save Style Sheet File As dialog ( Figure 7.10 ). Choose where to save it and what to name it, and click Save. |
5. | The CSS Rule Definition dialog will appear ( Figure 7.11 ). You can create the specific rules you want for links either here or directly in the CSS panel ( Figure 7.12 ). |