 |
 |
 |
|
 |
Parkland
College > CSIT
Dept > Digital Media > CIS 152 >
Calendar > Lesson 9
CIS 152 WEB DESIGN I
Lesson 9: CSS and JavaScript in Dreamweaver
Instructor: Paul
Young
|
| |
Objectives
|
|
To become more comfortable in the Dreamweaver
environment by constructing a complete web site similar to this
site.
|
| |
Discussion
|
|
Just as in print, visually appealing
web pages involve a balanced layout and clean typography. In this
lesson, we'll pay particular attention to these issues.
Tables were not originally design for layouts, but many layout "tricks" in
web design still require the use of tables. In this lesson, we'll
make use of tables to hold pixel elements.
Good web typography requires the use of Cascading
Style Sheets (CSS). Using CSS, designers can control line spacing
and precise font sizes with pixels. CSS can also remove the ugly
underline for links that is the default for HTML. For more information
on web typography, read this excellent article from Webmonkey.
|
| |
Procedure
|
|
Overview: Import optimized pixel elements
into Dreamweaver, add tables and layers. Create a CSS style
sheet. Add JavaScript behaviors. Make and apply template style. Test, publish to server.
Creating the home page
- copy files from "cis152/upload/lesson6_html" to "lesson9_html"
- launch Dreamweaver
- edit > preferences: category=css styles: do not open css files when modified
- define a new site (site > new site): name=lesson9,
local root folder=cis152/upload/lesson9_html
- open "index.html"
- select all content, DELETE
- insert > layout objects > layer
- insert > table inside layer (4 rows, 1 col)
- select all cells: align horiz=center
- insert "spacer.gif" in row 2 (w=100, h=50)
- insert appropriate images in other rows
- select table: cell padding=0, cell spacing=0
- select layer: T=50%, L=50%, others=blank
- file > preview in browser (F12)
- window > css: add new class ".center" (define in "dm.css")
- category=box: margin left=-512, margin top=??
- apply ".center" class to layer
- add hotspots, link each hot spot to an external site (target=_blank)
- window > css: add tag "body" (define in "dm.css")
- category=box: margin=0 (all); category=background: color=black
- file > preview in browser (F12)
Finishing the HTML file
- insert > html > head tags > description
- insert > head > key words
- window > snippets: meta > no cache (insert in code view)
- add alt tags
- commands > clean up HTML
Creating the inside pages
- open "curriculum.html"
- modify > page properties: tracing image="tracing.jpg" (50% opacity)
- select all text, draw new layer "text", paste text inside layer
- adjust layer position to match tracing image, L=20%, W=50%, T=??, H=blank
- file > preview in browser (F12)
- open "links.html", copy table, close
- draw new layer "links", paste table inside layer
- select "links" layer: W=blank, H=blank, reposition layer
- insert > image "upperRight.jpg", align=right
- drag named anchor "top" to top of file
- modify > page properties: category=tracing image: "tracing.jpg" opacity=0%
Making CSS styles
- window > css: link "dm.css"
- new CSS style: redefine tag <p>: font=verdana, size=11, line height=18,
color=??
- new CSS style: redefine tag <a>: decoration=none,
color=??
- new CSS style: advanced "a:hover": decoration=underline
- new CSS style: redefine tag <ul>: category=list: type=square
- open "dm.css", add <li> and <td> tags to <p> tag
- duplicate <p> tag, rename <h3>: type weight=bold, color=??
- duplicate <h3> tag, rename <h2>: type case=uppercase; category=border: bottom=1px solid, color=??; category=box: bottom padding=9, bottom margin=18
- duplicate <h2> tag, rename <h1>: font size=14; category=block: letterspacing=.35em
- new CSS style: class ".small": type size=9
- edit text, apply styles
- save, file > preview in browser (F12)
- finish the HTML file (see above)
Making JavaScript Rollovers
- select "link_01.jpg", add link
- window > behaviors: add "swap image" behavior,
choose "link-over_01.jpg"
- repeat with other link files
- repeat with links in "index.html"
Making a template
- open "curriculum.html"
- select <div> "text"
- insert > template objects > editable region "text"
- select <div> "links"
- insert > template objects > editable region "links"
- file > save as template "inside.dwt", close
- file > new: choose "inside.dwt" (template tab)
- file > save as "curriculum.html" (overwrite)
- select "link_02.jpg"
- swap "link_02.jpg" with "link-hit_02.jpg" (double-click)
- remove link, remove javascript behavior
- save
Applying template pages
- open "program.html"
- select all content, cut to clipboard
- modify > templates > apply template to page: "inside.dwt"
- select template text, paste
- apply CSS class "small"
- select "link_01.jpg"
- swap "link_01.jpg" with "link-hit_01.jpg" (double-click)
- remove link, remove javascript behavior
- save, repeat with other pages
Making gallery pages
- duplicate "dm.css", rename "gallery.css"
- open "1.html", attach "gallery.css"
- edit CSS for <body>: category=box: margin top=25px
- insert > layout objects > div tag (centered)
- move art into <div> tag
- repeat with other gallery pages
- grading: publish and make links from your personal web site to this lesson
|
|
|