190 likes | 330 Views
Chapter 5. Templates & Style Sheets. Objectives. Apply Cascading Style Sheet attributes to a template Create a Web page from a template. Describe a template Create a template Describe different types of style sheets Create a Cascading Style Sheet. Understanding Templates. Template
E N D
Chapter 5 Templates & Style Sheets
Objectives • Apply Cascading Style Sheet attributes to a template • Create a Web page from a template • Describe a template • Create a template • Describe different types of style sheets • Create a Cascading Style Sheet
Understanding Templates • Template • A predesigned Web page that defines the appearance of the page, including default font, font size, logos, images, & backgrounds. • Provides an alternative to separately creating many similar pages. • Can save time & can help create a consistent & standardized design. • First step is to determine the look of the page.
Creating A Template • 3 methods: • Create template from existing file • Open file > Save as Template command on File menu > define editable regions • Create template from new document Basic page • Use Save as Template command on File menu • Use File menu New command and select HTML template in New Document dialog box
Saving A Template • Dreamweaver automatically creates Templates folder in Web site local root folder. • Template saved with a .dwt extension within Template folder.
Using The Dreamweaver Template • Dreamweaver Template • A special type of HTML document • Template instance • A Web page based on a template, but you can only make changes to designated parts of template instance. • Editable Regions • Can be any part of a page (heading, paragraph, table..) • You designate what regions can be changed. • Templates provide the ability to update multiple pages at once.
Specifying Editable & Noneditable Regions • As author, you define which regions are editable • 4 types of regions • Editable Region • Basic building block of a template & is an unlocked region (can edit). • Repeating Region • A section in a document that is set to repeat. • 2 types • Repeating table, & repeating form.
Optional Region • Lets the content developer show/hide content on a page-by-page basis. • Editable Tag Attribute • Lets the content developer unlock a tag attribute in a template & edit the tag in a template-based page.
Designing The Template • Method • Finalize a single page that includes all elements you want in template. • Save the document as a template & mark all of the editable regions. • Consider following when designing template: • Include as much content as possible. • Use prompts in the editable regions to inform the content developer as to the type of content to be added to a particular region. • Give your editable regions meaningful names. • Use placeholder if possible, particularly for images
Adding Tables For Images & Links • Placeholder • Provides Web page developer with a guide as to what is to be placed in the cell & the required format (left, right, centered)
Adding Editable Regions • How to get there? • Insert Bar > Common Tab > Templates
Introduction to Style Sheets • Style • A rule describing how a specific object is formatted. • Style Sheet • A file that contains a collection of these rules or styles.
HTML Styles • A Dreamweaver feature that a Web page developer can use to apply formatting options quickly and easily to text in a Web page. • If style is changed, changes are not updated automatically. • To use: • Deselect “Use CSS instead of HTML Tags” option in General category of Preferences dialog box.
Cascading Style Sheets • A collection of formatting rules that control the appearance of content in a Web page. • DHTML • An extension to HTML that enables a Web page to respond to user input without sending a request to the Web server • Style Rule contains two parts: • Selector – name of the style • Declaration – defines the style elements
Three different selectors: • Class (custom style) – specify all the attributes you want the style to include. • Tag – Make global changes to existing Web pages by modifying the properties/attributes of HTML tag. • Advanced – Commonly applied to hyperlinks to create a rollover effect.
Conflicting Styles • Cascading • Refers to the capability of applying multiple style sheets to the same Web page. • Order of Preference: • External Style Sheet – a single style sheet that is used to create uniform formatting and contains no HTML code • Internal style sheet (embedded style sheet) – contains styles that apply to a specific page. • A specified element within a page
The CSS Styles Panel • Styles are created and controlled through the CSS Styles panel. • Custom style • A style you can create and name, in which you specify all the attributes you want the style to include.
CSS Styles Panel Buttons • Attach Style Sheet – links to/imports external style sheet into your current document • New CSS Rule – Defines a type of style • Edit Style Sheet – Edit any of the styles in the current document/ in external style sheet • Delete CSS Rule – Removes selected style from panel, & removes formatting from any element to which it was applied