Using CSS styles with templates
This TechNote discusses how to apply Cascading Style Sheets (CSS) to templates and documents created from templates. A working knowledge of both CSS and templates in Dreamweaver is recommended before following the steps outlined in this TechNote. To gain a better understanding of CSS styles and/or the use of templates in Dreamweaver, consult the TechNotes listed in Additional Information below.
CSS stylesIn terms of where the style sheet information is located, Dreamweaver uses two kinds of CSS styles:
| |
Linked
Sometimes CSS styles are applied to a document by linking to styles listed on an independent, external style sheet, thereby making the style sheet available to the entire site. These styles are referred to as linked styles. |
| |
Document-level
CSS styles can also be applied to elements of a document using STYLE tags in the document itself. These "internal" styles are termed document-level styles. |
This TechNote compares the application of both kinds of CSS styles to templates and to documents created from templates, as follows:
| |
Adding styles to templates(DWT files)
In either Dreamweaver 3 or 4, you can add both document-level styles and linked styles to the original template (DWT file). Styles added to the template will also be present in documents created from that template. |
| |
Adding styles to documents created from templates(HTML documents)
You cannot add linked styles to a document created from a template. You can add linked styles to a document created from a template just as you would any other document. Document-level styles
created from a template 1 After opening the template (DWT file), look at the source code. 2 Notice that the 3 To add newstyletags:
Enter the above code so that it immediately follows " To move existing STYLE tags:
a Select the existing STYLE tags and the content in between. b Choose Edit > Cut. c Place the insertion point at the end of " 4 Save the template, and choose Yes if prompted to update documents created from the template. Any document created from the new or modified template will then allow you to apply document-level styles. Â |
For more information about CSS styles or templates, consult:
| |
CSS Styles
An overview of Cascading Style Sheets (Technote 15230) How to create document-level Cascading Style Sheets (TechNote 15231) How to create an external Cascading Style Sheet (TechNote 12922) Â |
| |
Templates
Understanding editable and noneditable regions in templates (Technote 14804) Important information to consider when using templates (Technote 14627) Adding content to pages based on a template in Dreamweaver 4(Technote 14908) Adding behaviors to templates and to documents created from templates (Technote 14797) Using Library items to add behaviors to documents created from templates (Technote 14852) How to incorporate image maps in templates (Technote 13880) |
This content requires Flash
To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.
Download the free Flash Player now!
