This part of the workshop uses Dreamweaver 8 to create style sheets. Instead of moving from a local to global use of style sheets, we'll do the opposite. The rules will be made globally and then we'll override them.
Open Dreamweaver and a page to practice on:
- Open Dreamweaver
- Go to "File" menu
- Choose "Open..."
- Locate the folder "CSSExercises"
- Open the folder "CSSExercises"
- Open "StyleMe.html"
External Style Sheet
To make an external style sheet for the page "StyleMe.html":
- control-click (Mac OS) or right-click (Windows) in the edit window
- choose "CSS Styles>New..." (see "Figure 2: New CSS Rule")
Figure 2: New CSS Rule
- click on "Tag (redefines the look of a specific tag"
- in the "Tag:" field, choose "p" from the drop-down menu
- next to "Define in:" click on the radio button next to the drop-down menu
- choose "New Style Sheet File"
- click "OK"
- in the dialog box that pops up, name the file "ExternalStyleSheet"
- save the file in your "CSSExercises" folder
- click "OK"
You'll get the window in "Figure 3: CSS Rule Definition for p in ExternalStyleSheet.css dialog box."
Figure 3: CSS Rule Definition for p in ExternalStyleSheet.css dialog box
Using the category "Type":
- in the "Font:" box type "sans-serif"
- in the "Size:" box type "2.0"
- choose "ems" from the drop-down menu to the right of the "Size:" box
- click "OK"
- click "Save"
- click "Done"
Notice the increased font size and the change from a serif font to sans-serif.
Rule Embedded in the Page
This process is similar to the one you just completed.
- control-click (Mac OS) or right-click (Windows) in the edit window
- choose "CSS Styles>New..." (see "Figure 4: New CSS Rule dialog box")
Figure 4: New CSS Rule dialog box
- choose "Tag (redefines the look of a specific tag)"
- in the "Tag:" field, choose "p" from the drop-down menu
- next to "Define in:" click on the radio button next to "This document only"
- click "OK"
Using the category "Type":
- in the "Font:" box type "serif"
- in the "Size:" box type "0.8"
- choose "ems" from the drop-down menu to the right of the "Size:" box
- click "OK"
Notice the decreased font size and the change back to a serif font. The style rule in the page overrides the external style sheet rule.
Rule in the HTML Tag
- click in the sentence "Here is some text."
- at the bottom of the edit window, control-click (Mac OS) or right-click
(Windows) on the
<p>tag - choose "Quick Tag Editor..."
- hit the "space" bar on your keyboard
- type: style="font-size:4.0em"
- click in the edit window
Notice the increased font size. The rule in the HTML tag increased the size, but the rule embedded in the page made it a serif font. Both override the external style sheet!