Designing with Cascading Style Sheets in Dreamweaver

Patricia Rees

Web Producer, Pasadena City College

Introduction to Designing with CSS in Dreamweaver

Overview

What is CSS?

Why  use CSS?

Tools for working with CSS

Valid HTML - good structure

Validation

New HTML document in Dreamweaver

Techniques - Create a style in Dreamweaver 8

Techniques - Create a style in Dreamweaver 8

Look at CSS Basics and Syntax

Fonts

Techniques - Tag and Class Selectors

Class-itis: Before using a class selector, you should ask yourself:
  • Is there an existing HTML element that could be used instead?
  • Is there a class or id further up the document tree that could be used with a html tag to define this style rule?
  • Do I want to use this style in many places throughout my site?

Look at HTML Basics and Syntax

Look at HTML Basics - Inline vs. Block Elements

Techniques - ID Selectors

CSS Shorthand

handout

Naming Conventions Classes and IDs

Class-itis: Before using a class selector, you should ask yourself:
  • Is there an existing HTML element that could be used instead?
  • Is there a class or id further up the document tree that could be used with a html tag to define this style rule?
  • Do I want to use this style in many places throughout my site?

Techniques - Create a style in Dreamweaver 8

Cascade or inheritance

  • Source order, embedded, inline
    • lower or closest
  • Specificity (weight)
    Universal selector: * 0,0,0,0
    Element: p 0,0,0,1
    Class and pseudo class selector:
    .feature a:link
    0,0,1,0
    Id selector: #nav 0,1,0,0
    Inline style:
    <span style="color: #FFF;">
    1,0,0,0
  • !Important declaration - use for diagnostics, but try not to leave in your css
[any material that should appear in print but not on the slide]

Techniques - CSS Styles panel in Dreamweaver 8

  • set properties in alphabetical order
  • grouped into categories (default)
  • alphabetical list of all available properties
  • set properties are displayed in blue;
  • properties irrelevant to a selection are displayed with a red strike-through line.
  • Holding the mouse over a rule that is irrelevant displays a message explaining why

Techniques - CSS Styles panel in Dreamweaver 8

Techniques - Box model

box model

Techniques - Box model

box model IE5

Positioning

Positioning - Float

Positioning - Relative

Positioning - Absolute

Positioning - Fixed

Positioning - source order

Layout Examples

Layout - Default Margins

Typography (DW type dialog box)

Typography (DW block dialog box)

Navigation and list style

Borders

Links

Background graphics

Background graphics

Tables

Forms

Forms

Media type / Alternate style sheets

Descendant selectors

Descendant selectors

Parent and child, adjacent siblings

Descendant selectors

Design / workflow / style sheet organization

Accessibility

Tips and Tricks

Tips and Tricks

Tips and Tricks

Bugs, Fixes and Hacks (oh, my!)

Bugs, Fixes and Hacks (oh, my!) - IE styles

Bugs, Fixes and Hacks (oh, my!)

Tips and Tricks - efficient CSS

Tips and Tricks - efficient CSS

On your own

On your own

On your own

Contact