Dreamweaver Introduction
(Vendor Web Site: http://www.macromedia.com/)
{Much of this discussion can be found in:
Coley, L. How to Use
Dreamweaver 4 and Fireworks 4, Sams Publishing, Indianapolis, IN, 2001,
ISBN:0-672-32041-X,
Towers, J. Dreamweaver for Windows and Macintosh
(4)(Visual Quickstart Guide), Peachpit Press, Berkeley, CA, 2001, ISBN:
0-201-73430-3. (Online References: http://www.peachpit.com/ , Online
Materials for the book: http://beta.peachpit.com/vqs/dreamweaver/)
See
also References]
Preliminaries
Text
Entering Text (Using the Properties Inspector)
Aligning Text (Using the Properties Inspector)
Images (Including Imagemaps)
Hyperlinks
Tables (with Text and Images)
Forms
Frames
Cascading Style Sheets (CSS)
Checking Browsers...
Rollovers
Jump Menus and Jump Go Menus
Ready-Made Navigation Bars
Layers (Including Drag Layers)
Preliminaries
Taskbar
Close all windows except the Document Window (Title Bar will include "Untitled Document..." xxx . All of these closed windows (inspectors, etc.) can be re-opened via Window/... on the Menu Bar.
Defining a New Site -- Optional (Might be problematic if you work from several computers)
From the Menu Bar: Site/New Site yields the Site Definition Dialog Box with the following notes/settings:
Category: Local Info
Site Name: Your choice (e.g. MyFirstDWSite)
Local Root Folder: Someplace on your hard drive
HTTP Address: Where it will be on the server
All Checkboxes checked
Click: OK OK
Note: To examine the site later, use Menu Bar and Site/Open Site > ...
Views
Setting Page View (Helpful in checking for views from monitors of varying resolutions, and exact placement of objects)
Rulers -- Menu Bar: View/Rulers>Show (Default is Pixels)
Gridlines -- Menu Bar: View/Grid>Show
Grid
Change Gridline Appearance via View/Grid/Edit Grid ...
Current Window Size is shown on the Status Bar. Click adjacent arrow for pop-up menu of resolution choices
Menu Bar: View/Code
Other Options:
View/Design
View/Code and Design
O'Reilly References (HTML, Style Sheets, JavaScript References)
Version 4 of Dreamweaver offers help with the syntax related to the code in HTML, Style Sheets and JavaScript.
The O'Reilly Reference Window can be opened from the Menu Bar via Window/Reference .
Notes:
The Reference Window can be resized via sizing handles. There is no maximization button with this window.
To pick which area (HTML, Style Sheets, JavaScript), use the appropriate option from the drop-down list associated with the Book field. The other fields change appropriately with your choice of book.
Menu Bar items discussed:
Window/...
View/...
Site/...
Text
Entering Text & Formatting
Text (Using the Properties Inspector)
From the Menu
Bar: Text/...
Preliminaries:
Set Code and Design View (Menu Bar: View/Code and Design) -- Note: You might have to drag down one of the windows.
Display the Properties
Inspector ( Menu Bar: Window/Properties)
Note:
The Properties Inspector varies depending on the object chosen. This
is the one you will see for dealing with text. Compare it to some of
what you might see on the Formatting Toolbar of Microsoft
FrontPage.
Display the Launcher (Menu Bar: Window/Launcher)
Enter some text, using Enter and Shift+Enter
Select the text and on the Properties Inspector click the down arrow adjacent to the color swatch for the color picker, Dragging the eyedropper, choose a color for the text.
Note: Size drop-down list for picking basefont
Note: Bold, Italics (buttons in the Properties Inspector) and Underline (underline via Menu Bar: Text/Style/Underline)
Applying a Group of Formatting Options
(Styles): Click on HTML Styles on the Launcher and
pick from options.
Note: You can also define a New Style.
Aligning Text (Using the Properties Inspector)
Right and Left Alignment
Centering
Indenting and Outdenting
Use the Fonts Drop-Down List on the Properties
Inspector
OR
From the Menu Bar: Text/Font>...
To change the combinations, use the Menu Bar: Text/Font>Edit Font List...
Importing an HTML Document from Word
Sample of Word document using clip art and table of contents: toc.doc . Note the files created when using the File/Save as Web Page... in Word: toc.htm, toc_filelist.xml, toc_header.htm, toc_image001.wmz, toc_image002.gif .
File/New (if not already in an new file)
File/Import>Import Word HTML ... find and open file; use defaults in dialog boxes
File/Save As ... (e.g. tocdw.htm)
Compare the two files in browsers and editors
Via the Properties Inspector if the options available are sufficient
Otherwise use Menu Bar: Text/List>...
For Sublists, select the sublist and use the Indent Button of the Properties Inspector
To change formatting on some part of the list:
Place the cursor at the beginning of one of the list items
Click on the down arrow (expand arrow) in the lower left-hand corner of the Properties Inspector
Click on the List Item... button of the Expanded Properties Inspector
Use the List
Properties Dialog Box to make changes
Alternative: From the Menu Bar: Use the Text Menu and Text/List>... to specify a list.
Defining Cascading Styles for Text
Open a file that contains some formatting, e.g. intro1.htm
Click on CSS Styles in the Launcher (Recall, Window/Launcher will get it on the Dreamweaver screen if it is not currently visible)
This should give the CSS Styles Panel
Now begin to define some styles that are going to be applied to the file (e.g. intro1.htm) by clicking on the New Style Button
This will yield the New Style Dialog Box
Make certain the Make Custom Style Radio Button, as well as the New Style Sheet File Radio Button are chosen
Specify a name in the Name: field (e.g. cssintro1)
Clicking on OK will yield the a Save As ... Dialog Box. Specify the file name and Click on: OK
Make some specifications in the Style Definition Dialog Box and Click on OK. This should save the choices in the file you specified (e.g. cssintro1.css) and will be reflected in the newly displayed CSS Styles Panel.
Select text in the original HTML file (e.g. intro1.htm)
and Click on the newly defined style sheet in the CSS Styles Panel. If
the AutoApply checkbox is checked the specifications will be applied to your
file (e.g. see intro2.htm)
Note:
If you want to apply the styles specified in this style sheet to other files
on subsequent occasions, you might need to Click on the Attach Style
Sheet Button
on the CSS Styles Panel (Lower right-hand corner).
Alternative: From the Menu Bar: Use the Text Menu and Text/CSS Styles>... to specify a list.
From the Menu Bar: Text/Check Spelling . Compare to Word and FrontPage.
Searching and Searching and Replacing
Edit/Find and Replace... Compare to Word and
FrontPage
Notes:
Options in the drop-down list of the Find In: field of the Find and Replace Dialog Box allows searching across a web site
Options in the drop-down list of the Search For: field of the Find and Replace Dialog Box allows search for HTML tags.
Menu Bar items discussed:
Window/...
Text/...
File/...
Edit/...
Inspectors discussed: Properties
Others: Launcher (HTML Styles; CSS Styles)
Images (Including Imagemaps)
Goal: Place cs2388.jpg at the top and centered in intro1.htm
Open intro1.htm and if Dreamweaver is not showing the Objects Panel--(Common), open it with Window/Objects (if the Common Objects is not displayed, get it via the drop-down list near the top of the panel).
Insert a blank line at the top of the intro1.htm file. Leave the cursor at this top position.
Click on: The Insert Image Button if the Objects Panel
-- (Common) and specify cs2388.jpg (via typing or browsing)in the File
name: field of the and Click on:
Select
Note: If your image is still selected, then
the Properties
Inspector (Image) (recall, Window/Properties will get the
Properties Inspector if it is not on the screen) is different from what we
have seen with selected text (Properties
Inspector ), since it reflects the options available for whatever is
selected.
Move the cursor to the right of the image and the Properties
Inspector is back to the one used earlier. Center the image.
This should yield a result similar to intro3.htm.
Alternative: From the Menu Bar: Use the Insert Menu and Insert/Image for image placement and the Text Menu and Text/Align>Center for centering the image.
Click on the image and the Properties Inspector (Image) (recall, Window/Properties will get the Properties Inspector if it is not on the screen) will provide the appropriate options.
Imagemaps (We will use the same example given for the Microsoft FrontPage demonstration)
Open the file 9demo5.htm in Dreamweaver. This displays contains the button_composite.gif image
Click on the image and if the Properties
Inspector (Image) is onscreen (recall,
Window/Properties will get the Properties Inspector if it is not on
the screen) you will see a "Map" section
on the Properties Inspector.
Click on the rectangular hotspot button
and drag the cursor
to enclose the "Mail" part of the image. When you release the cursor
the Properties
Inspector (Hotspot Specification) will appear (different context,
different appearance)
Type: "mailto:rs01@swt.edu" in the "Link" field of the Properties Inspector.
Follow the same process for "Home", using http://www.txstate.edu/cs/course/2388/sawey and http://www.swt.edu for "Join"
The completed work can be seen in 9demo6.htm.
Menu Bar items discussed:
Window/...
Insert/...
File/...
Inspectors discussed: Properties
Hyperlinks
External Links (Outside the current web site)
Example Using search.htm (derived from search.txt via copy/paste with some editing via FrontPage to remove some <br> tags). This is a somewhat dated, but still useful, article on search engines.
Open search.htm in Dreamweaver (File/Open...). If the Properties Inspector is not on the screen, open it via Window/Properties. Expand the Properties Inspector (drop-down arrow in lower right-hand corner) if it is not so already and place the cursor in the "Link" field.
Insert two blank lines between the title ("Search engines have specific purpose") and the author's name ("By Dave Scott") and type: "Search Engine Tutorials"
Select "Search Engine Tutorials" and type:
"http://searchenginewatch.com/resources/tutorials.html" (without the
quotes) in the "Link" field of the Properties
Inspector.
Aside: copying and pasting from a web browser
into the Link field will also work.
Move to the bottom of the file and make the link for "Austin360" to be "http://www.austin360.com/". The results can be seen in search1.htm.
Internal Links (Inside the current web site or inside the current document)
Links to a Specific File:
Near the top of the article between "Saturday, September 25, 1999" and "We will never know..." insert two blank lines and type: "(Original Text Format)" and select the text inside the parentheses.
Assuming that you have search.txt
in your current folder, click on the "Browse for File"
button
on the Properties Inspector
Locate the file in the Select File Dialog Box and double-click on it.
Links to Anchors (Some applications call these "Bookmarks") within the Same File:
Open search1.htm, and after "September 25, 1999" press <Return> twice, move to the middle blank line and begin an bulleted list (e.g. via Menu Bar: Text/List>Unordered List). Set three bullets:
First bullet type: "Inktomi"
Second bullet type: "Google" and insert google.gif
Third bullet type: "Yahoo"
Placing the anchors (bookmarks):
Locate the paragraph beginning with "Inktomi Corp. is a..." (possibly use Edit/Find and Replace...). Make sure the cursor is at the beginning of this paragraph.
If not already on the screen, open the Objects Panel--(Common) (From the Menu Bar: Window/Objects). If the "Common" objects panel appears, click the drop-down arrow adjacent to "Common" and choose "Invisibles" from the menu of choices. This will yield the Objects Panel--(Invisibles).
Click on the anchor
button and type "inktomi" in
"Anchor Name:: field of the Insert Anchor Name Dialog Box and
Click OK.
Locate the paragraph beginning with "The custom-made engines ..." and insert an anchor with the name "google"
Locate the paragraph beginnng with "Yahoo still asks ..." and insert an anchor with the name "yahoo"
Specifying the links:
Return to the bulleted list and select "Inktomi"
Type: "#inktomi" in the "Link" field of the Properties Inspector (If Properties inspector is not onscreen, Window/Properties will get it). Note: You have to type the "#".
Select the Google image in the second bullet of the list (Note: The Properties Inspector (Image) changes in context to accommodate the image) and type "#google" in the "Link" field.
Select "Yahoo" and specify "#yahoo" for this anchor.
The resulting work can be seen in search2.htm .
Menu Bar items discussed:
Window/...
Insert/...
Inspectors discussed: Properties
Panels discussed: Objects (Common, Invisibles)
Others:
Tables
(with Text and Images)
Open the demonstration file intro3.htm and move to the bottom of the file. Set the cursor at the beginning of a new line.
Check the View (Menu Bar: View/Table
View>Standard View) to make sure that you are in the Standard
View, rather than Layout View (Aside: You can also use the
Standard View (the one on the left) from the View
section of
the Objects
Panel--(Common) .)
From the Menu Bar Click on: Insert/Table from the Insert Menu and complete the Insert Table Dialog Box, taking the defaults, except to make sure to have the following:
Rows: 4
Columns: 2
Width: 100 Percent
Note: The Insert Table
Dialog Box is also available from the Objects
Panel--(Common) by picking the Insert Table Button
Click on: OK. This should give the Properties Inspector (Table)
We will use the top row for the Header and the following three rows will have a label in the first column and a different Properties Inspector view in each row of the the second column (intro4.htm shows the finished product).
Select the first row and note that you now have a somewhat
changed Properties
Inspector (Table--Row) Click on: the Merges selected cells
using spans button
and after setting boldface and centering via the Properties
Inspector, type: "Three Views of the Properties Inspector"
In the first column type the following:
Row 2: "For Text"
Row 3: "For Images"
Row 4: "For Tables"
Select the cells in which the text has just been typed and boldface the text via the Properties Inspector.
Move middle table border so that it just allows space for the text just typed in column 1.
We now insert the following images in rows 2, 3, 4 of column 2, propertiesinspexp.gif, propertiesinspimage.gif and propertiesinsptable.gif, respectively.
Place the cursor in the second row of the second column and move again to the Insert Menu of the Menu Bar and Click on: Insert/Image and find or type propertiesinspexp.gif and Click on: Select. Proceed in a similar manner with the other two images.
Move the right-hand border of the table to just hold the image you have just inserted.
Select the entire table and choose Center from the Align drop-down list on the Properties Inspector (Table) . This should center the table.
Select the top cell and and from the "Bg" color palette pick a background color for this cell. Proceed in a similar manner to pick another background color for the remaining cells. (Note: Selecting the cells/rows via mouse and Ctrl-Click can effect the selection). Intro4.htm shows one possible outcome.
Menu Bar items discussed:
Window/...
Insert/...
Inspectors discussed: Properties
Panels discussed: Objects (Common)
Forms
Initial Setup (Including Inserting a Horizontal Rule)
Open the demonstration file, intro4.htm, and move the cursor to a blank line at the bottom of the file.
Insert a horizontal line, using the Menu Bar and Insert/Horizontal Rule. By now it should be no surprise that the Properties Inspector (Horizontal Rule) has changed to fit the context/current object. Press <Return> to place the cursor on a new line
As with the tables discussion, make sure that the Properties Inspector (Menu Bar: Window/Properties) and the Objects Panel--(Common) (Menu Bar: Window/Objects) are both onscreen.
Using the "drop-down" arrow adjacent to "Common" on the Objects Panel, click on this arrow and click on Forms so that you now have the Objects Panel -- (Forms).
Center and Boldface the heading: "Some Background Questions". Intro5.htm shows the finished result.
Inserting a Form and Radio Buttons
Start a new line and type in the first part of question 1. : "1. Of the following, which is your favorite web site?" and press <Return>
From the Menu Bar, Click on: Insert/Form . Your screen should show the outline of the form's space via a red dashed line.
Notes:
The Properties Inspector (Form) now reflects the new object.
This step could also have been accomplished from the Objects
Panel -- (Forms) via the Insert Form Button
Type in a web site (e.g. Yahoo) and from the Menu Bar, Click on: Insert/Form Objects>Radio Button . This will insert a radio button.
Notes:
The Properties Inspector (Radio Button) now reflects the new object.
This step could also have been accomplished from the Objects
Panel -- (Forms) via the Insert Radio Button Button
Repeat this process for two more sites. Intro5.htm shows a sample result.
Start a new line and type in the first part of question 2. : "2. Which of the following web browsers have you used?
Start another new line (Press <Return>) and from the Menu Bar, click: Insert/Form Objects>Check Box. This will insert a checkbox.
Notes:
The Properties Inspector (Check Box) now reflects the new object.
This step could also have been accomplished from the Objects
Panel -- (Forms) via the Insert Check Box Button
Move the cursor (mouse or arrow key) to the right and type a browser name (e.g. Netscape).
Start another line and repeat this process two more times with other browser names. Intro5.htm gives an example of such work.
Start a new line and type in the first part of question 3. : "3. Pick the HTML editor you recommend the most highly:
Start another new line (Press <Return> or
Shift/<Return>) and from the Menu Bar, click:
Insert/Form Objects>List/Menu. This will insert the first
part of a List or Menu form object
. You will now need to
complete the items in your list or menu, but as before:
Notes:
The Properties Inspector (List/Menu) now reflects the new object.
This step could also have been accomplished from the Objects
Panel -- (Forms) via the Insert List/Menu Button
Click on the: List Values... of the The Properties Inspector (List/Menu) and fill in three different browsers (e.g. Netscape, Internet Explorer, Opera) when the List Values Dialog Box appears. Note: You will need to use the "+" button to add entries in the list.
When finished with the list, click on: OK. Intro5.htm gives an example of such work
Start a new line and type the fourth "question: "4. Your name:"
Start another new line, and from the Menu Bar, click: Insert/Form Objects>Text Field. This will insert the text field.
Notes:
The Properties Inspector (Text Field) now reflects the new object.
This step could also have been accomplished from the Objects
Panel -- (Forms) via the Insert Text Field
Button
Type: 25 in the "Char Width" field and 45 in the "Max Chars" field. When you move the cursor from the text field, these changes will take effect. Intro5.htm gives an example of such work.
Start a new line and from the Menu Bar: click: Insert/form Objects>Button . This will insert a button (Submit is the default).
Notes:
The Properties Inspector (Button) now reflects the new object.
This step could also have been accomplished from the Objects
Panel -- (Forms) via the Insert Button
Type: "Send Info" in the "Label" field of the The Properties Inspector (Button) . This change will take effect when the cursor is moved from the button. Intro5.htm gives an example of such work.
Adjacent to the "Send Info" button, insert a "Reset" button. Intro5.htm gives an example of such work.
Menu Bar items discussed:
Window/...
Insert/...
Inspectors discussed: Properties (Form, Radio Button, Check Box, List/Menu, Text Field)
Panels discussed: Objects (Forms)
Frames
Goal: Construct frameset1.htm,
containing two vertical frames
. In the left
frame, we will start with tocfr1a.htm
and finish with tocfr1b.htm
. In the right frame, we will have howdy.htm
as the initial file, where this is the target frame for most of the
links in the left frame.
Open a new file (Menu Bar: File/New) and from the Menu Bar, click: Insert/Frames>Left. The two vertical frames will appear in the Design Window, surrounded by dashed lines.
Note:
The same result could be accomplished by clicking on
the Insert Left Frame Button
in the Objects
Panel -- (Frames)
Recall: The Objects Panel is available via the Menu Bar, by clicking: Window/Objects. If the Frames Objects Panel is not displayed, it is available via the drop-down list near the top of the panel.
Save the frameset via the Menu Bar and File/Save Frameset As... , typing frameset1.htm in the File name: field
Note: You should save this frameset before continuing to avoid "complaints" from Dreamweaver later.
Loading Frames with Existing Files (and Name the Frames)
You will first need the Frames Panel . The Frames Panel is available via the Menu Bar by clicking: Window/Frames.
Click on the left frame of the Frames Panel. Note: The Properties Inspector changes to reflect the context [ Properties Inspector (Frames & Frames Panel) ].
In the Frame Name field of this Properties
Inspector, type "framea". In the Src field,
type "tocfr1a.htm" and press: <Return>. Note:
Using the folder button
and browsing for the file will
also work (if the file already exists, of course).
Click in the right frame of the Frames Panel , typing "frameb" in the new Frame Name field and "howdy.htm" in the Src field, and pressing <Return>.
Save the changes via File/Save Frameset As... (if you are uncertain where frameset1.htm is located, or have not yet save the frameset), or just File/Save Frameset .
Changing the Frame Widths and Noting the Frameset Properties Inspector
Notes:
Clicking in either of the frames allows you to make changes in either of the files contained in that particular frame and the Properties Inspector will change to reflect this fact. Furthermore, you can save any changes made with File/Save As... or File/Save .
Not surprisingly, changing the frame width can be easily accomplished by moving the mouse until you have the double-headed sizing arrows and dragging appropriately. The primary point of this section is to show how to get the Properties Inspector (Frameset) and get an exact pixel width for the left frame.
Move the mouse cursor between the two frames until the double-headed sizing arrows appear and Click the left mouse button. The Properties Inspector (Frameset) should appear. Make certain that the left-hand frame is selected in the Properties Inspector.
Drag the sizing handles until the Column Value is approximately 120 pixels, and save the frameset (frameset1.htm) again.
Specifying Targets for Links in a Frame File
Notes:
At this point clicking on links in framea -- the left-hand frame (tocfr1a.htm) will cause the sites to be displayed in the same frame. The obvious goal here is to display the sites in the right-hand frame (frameb, currently displaying howdy.htm)
We will change the first link individually (via the target attribute associated with the anchor tag, sending it to "_top"), and the other two via the base tag and the target attribute in the head section of tocfr1a.htm and save the work in tocfr1b.htm so that the two can be compared.
Click in the left-hand frame. Notice that you get the Properties Inspector (Text) . Select the first link in the list.
Click on the drop-down list associated with the Target field to get the Properties Inspector (Target) . Notice that the names for the two frames are on this list. Click on "_top".
From the Menu Bar, click on Insert/Head Tags>Base. When the Insert Base Dialog Box appears, click on the drop-down list associated with the Target field and select frameb, leaving the href field blank, and clicking on OK.
From the Menu Bar, use File/Save Frame As... to save this file as tocfr1b.htm .
Close this session via File/Close from the Menu Bar. You will be asked if you want to save changes in frameset1.htm . Click on: Yes. Why?
Note:
You could also have obtained the Insert
Base Dialog Box via the
Objects Panel -- (Head) (If not visible, use
Window/Objects from the Menu Bar to get the initial
Objects Panel) and click on the Insert Base Button
.
Menu Bar items discussed:
Window/...
Insert/...
Inspectors discussed: Properties (Frames, Frameset)
Panels discussed: Objects (Frames, Base), Frames
Cascading Style Sheets
(From Towers Dreamweaver book: "A style is
a group of attributes that are called by a single name, and a style sheet
is a group of styles.)
Begin with css1.htm,
which contains no style specifications and obtain the Styles
Panel (If not visible, use Window/CSS Styles from the Menu
Bar). Note: The shortcut menu button
on
this Styles Panel and the Styles
Panel (with Shortcut Menu) once this button is clicked.
We will be using the options available on this Shortcut Menu.
The goal will be to use Dreamweaver to produce similar results to those discussed in the HTML-oriented discussion of CSS (cssinternal1.htm through cssinternal3.htm).
Specifying "Non-Class" Styles: Generating a result similar to that of cssinternal1.htm (specifying H1 and P Styles -- Results in css2.htm):
After opening css1.htm and displaying the Styles Panel, use the shortcut menu button (all noted above) and click on: New Style... (cssinternal1.htm through cssinternal3.htm)
When the New Style Dialog Box appears, make the following settings:
For h1:
Select Tag field: h1
Type radio button: Redefine HTML Tag
Define in radio button: This Document Only (This will put the specification in the <HEAD> section ... of only this file)
Click on: OK and this will give the Style Definition Dialog Box (for h1)
Make the settings for the following Category choices:
Click on: OK
For p (Returning to Styles Panel (with Shortcut Menu) then New Style Dialog Box:
Select Tag field: p
Type radio button: Redefine HTML Tag
Define in radio button: This Document Only (This will put the specification in the <HEAD> section ... of only this file)
Click on: OK and this will give the Style Definition Dialog box (for p)
Make the settings for the following Category choices:
Click on: OK
Save the work. Results to be seen in css2.htm .
Examine the Source Code in the <HEAD> section of this file.
Specifying and Applying Class Styles: Generating a result similar to that of cssinternal2.htm (specifying ".intro" class with P Styles):
Open css2.htm (if not already done) and and obtain the Styles Panel (If not visible, use Window/CSS Styles from the Menu Bar).
Using the Styles Panel (with Shortcut Menu) , click on: New Style ... in the Shortcut Menu and when the New Style Dialog Box appears, make the following settings:
Type radio button: Make Custom Style (class) (Do this first)
Select Tag field and type: ".intro" (including the period, but not the quotation marks)
Define In radio button: This Document Only (This will put the class specification(s) in the <HEAD> section ... of only this file)
Click on: OK and this will give the Style Definition Dialog Box (for .intro)
Make the settings as shown in the Category Type Style Definition Dialog Box (for .intro)
Click on: OK. This will define the ".intro" class attributes. We now need to apply them to some paragraph.
Note: The CSS Styles Panel now displays the "intro" class.
Note: The newly generated code in the <HEAD> section of the document.
Save the work in css3.htm. There is no change in the appearance of this file in a browser. Why?
We now apply this class to the text of the first paragraph of css3.htm
Select the text of the first paragraph of the file.
Turn off (via the checkbox associated with the Apply Button of the Styles Panel
Click on: intro style
Click on: Apply Button
Note: The <P> tag for the selected paragraph in the code for this document
css3.htm shows the finished work.
Specifying Anchor "Pseudoclasses": Generating a result similar to that of cssinternal3.htm, using "pseudoclasses for the A tag:
Open css3.htm (if not already done) and obtain the Styles Panel (If not visible, use Window/CSS Styles from the Menu Bar)
Using the Styles Panel (with Shortcut Menu) , click on: New Style ... in the Shortcut Menu and when the New Style Dialog Box appears, make the following settings:
Type radio button: Use CSS Selector (Do this first)
Define In radio button: This Document Only (This will put the class specification(s) in the <HEAD> section ... of only this file)
Select Tag field and Click on the drop down list and select: a:link
Click on: OK and this will give the Style Definition Dialog Box (for a:link)
Make the settings as shown in the Category choices:
Category Background Style Definition Dialog Box (for a:link)
Click on: OK
Follow the same process as just noted except:
Select Tag field and Click on the drop down list and select:
a:hover
AND
Make the settings as shown in the Category choices:
Category Background Style Definition Dialog Box (for a:hover)
Click on: OK
Save the work in css4.htm
Note: The changes in the <HEAD> section of the document
External Styles (Linked to an External File, Containing Styles Specification)
First, we start with a document that contains no styles (css1.htm) and while in this file create an external file containing style specifications (cssdemo1.css). Note: The *.css file will likely not be readily viewed in your browser. You might want to save it "locally" and view it with a text editor.
We will specify a yellow background for the file via an external style heet file, which we will create. Note: The process of defining the styles is the same as before, only the matter of creating and linking the document to the style sheet file is different.
Open css1.htm and follow the process outlined above to obtain the Styles Panel (with Shortcut Menu) and Click on: Edit Style Sheet ... (Note: This process is simpler if you use Edit, rather than New)
The Edit Style Dialog Box will appear. It is the Link... Button that we will be using. (Note: The box containing specifications is empty, since we have not styles currently specified.)
Click on: Link... and when the Link External Style Sheet Dialog Box appears, type the file name in the File/URL field (in this case cssdemo1.css, assuming it is in the same folder as the current document), and make sure the radio button for the As is radio buttons is the Link radio button.
Click on: OK and notice that the Edit Style Dialog Box reappears with the style sheet file now specified in the style specification area.
Click the New... button and set up the New Style Dialog Box indicated in the link. Note: The body tag and the css file specifications.
Click on: OK and set the Category Background Style Definition Dialog Box (for body in cssdemo1.css) as indicated for a yellow background.
Click on: OK
Save the work as css5.htm and Note: The code in the css5.htm and cssdemo1.css (in a text editor, not browser) files.
Creating (Exporting) from an Existing Document (Containing Style Specifications in the <HEAD> Section)
Goal: This section is intended to cover the situation where you have creates styles in a single (internal style sheet) file in the <HEAD> section by want to create an external file (cssdemo2.css) in which to store the styles and use them via links in other documents. We will start with css4.htm and its styles, create cssdemo2.css, and in the next section we will link this external style sheet file in another file, css6.htm (initially css1.htm).
Open css4.htm and as before, obtain the Styles Panel (If not visible, use Window/CSS Styles from the Menu Bar)
Using the Styles Panel (with Shortcut Menu) , click on: Export Style Sheet... and when the Export Styles As CSS File Dialog Box appears, type: cssdemo2.css in the File name field.
Click on: Save .
Note: The cssdemo2.css (view in an editor, not a browser) file now contains all of the style specifications that are contained in the initially opened css4.htm file.
Linking in an Existing Document
Open css1.htm and follow the process outlined above to obtain the Styles Panel (with Shortcut Menu) and Click on: Edit Style Sheet ... (Note: This process is simpler if you use Edit, rather than New)
The Edit Style Dialog Box will appear. It is the Link... Button that we will be using. (Note: The box containing specifications is empty, since we have not styles currently specified.)
Click on: Link... and when the Link External Style Sheet Dialog Box appears, type the file name in the File/URL field (in this case cssdemo2.css, assuming it is in the same folder as the current document), and make sure the radio button for the As is radio buttons is the Link radio button.
Click on: OK and notice that the Edit Style Dialog Box reappears with the style sheet file now specified in the style specification area.
Close the Edit Style Dialog Box and save the file as css6.htm.
Note: The Code in the <HEAD> section of css6.htm, linking the style sheet file cssdemo2.css. View the html file in a browser and note the first paragraph is unaffected, since we have not applied the ".intro" class to it.
Behaviors
[Major Source for this
part:
Towers, J. Dreamweaver for Windows and Macintosh
(4)(Visual Quickstart Guide), Peachpit Press, Berkeley, CA, 2001, ISBN:
0-201-73430-3. (Online References: http://www.peachpit.com/ , Online
Materials for the book: http://beta.peachpit.com/vqs/dreamweaver/)]
Dynamic HTML (DHTML): A combination of HTML and JavaScript, usually in conjunction with CSS styles.
Object: An HTML element (usually an HTML tag) in a web document.
Event: Shorthand for event and event handler. User Event is when the user or the user's browser performs some common task, e.g. clicking on a link, or loading a web page.
Event Handler: JavaScript shorthand for a user event.
Action: A set of programming (JavaScript) that is executed (usually when a user event occurs).
Behavior: An action that occurs when an
event happens to an object. Hence:
Event + Object = Action .
Steps in Specifying a
Behavior
Each of the "Customized Behaviors" discussed below will
involve the following steps (Note the order.):
Select an object (HTML tag) that will have an event and action associated with it.
Select the browser for which you want the behavior to work (if possible).
Select the action to be taken when the event occurs to the object.
Select the event that will trigger the action when the event occurs to the object.
Preliminaries
In each of
the behaviors described below the Behaviors Panel be used. Here we
discuss how to obtain this panel and related tools.
Open a document, e.g. behave1.htm and from the Menu Bar, click Window/Behaviors. This should give a version of the Behaviors Panel. Have this panel available for these behaviors discussions.
Status Bar
Changes
[This initial source file is from: Towers, J.
Dreamweaver for Windows and Macintosh (4)(Visual Quickstart Guide),
Peachpit Press, Berkeley, CA, 2001, ISBN: 0-201-73430-3. (Online
References: http://www.peachpit.com/ , Online
Materials for the book: http://beta.peachpit.com/vqs/dreamweaver/)]
This example has several links: behave1.htm
Select an object (tag). For example, select the link "Pioneer Valley"
Begin to select the action to take by clicking on the
Add Action Button
on the Behaviors
Panel. This will give a pop up/shortcut menu showing
the actions possible with this object (tag).
But first use the Show Events For> submenu will allow the selection of browser for which you wish to specify the behavior. Pick "4.0 and Later Browsers".
Continue to select the action. In this case, choose the Set Text>Set Text of Status Bar and type in the text of the message in the Set Text of Status Bar Dialog Box and click on: OK.
The Behaviors Panel is now set to select the event which will complete this behavior specification. Note: In this case the only event possible for this action is onMouseOver (Also note the Show Events For> submenu. This allows for changing the choice of browser again at this point).
Save the file in behave2.htm.
Test the file with a MouseOver and note the code in the <HEAD> section of the file as well as with the link in question.
Popup Messages
This
example tracks very closely that of the previous one. What follows is
a copy of the previous process and the differences are noted in red. Compare the differences and note the
parallel process and sequence of steps.
This example has several links: behave1.htm
Select an object (tag). For example, select the link "Send me comments"
Begin to select the action to take by clicking on the
Add Action Button
on the Behaviors
Panel. This will give a pop up/shortcut menu showing
the actions possible with this object (tag).
But first use the Show Events For> submenu will allow the selection of browser for which you wish to specify the behavior. Pick "4.0 and Later Browsers".
Continue to select the action. In this case, choose the Popup Message and type in the text of the message in the Popup Message Dialog Box and click on: OK.
The Behaviors Panel is now set to select the event which will complete this behavior specification. Note: In this case the only event possible for this action is onClick (Also note the Show Events For> submenu. This allows for changing the choice of browser again at this point).
Save the file in behave3.htm.
Test the file with a Click and note the code in the <HEAD> section of the file as well as with the link in question.
Opening a Browser
Window
This example will allow for the possibility of opening several
windows.
One of them will be about the size of the frame
that contains this set of links (table of contents) as it appears in the
initial 2388 web page frame outlay: http://www.txstate.edu/cs/course/2388/sawey/).
The file in question is: http://www.txstate.edu/cs/course/2388/sawey/toc.htm
. This one will be discussed below and the other links and
window-openings will be left for the reader to practice in
producing.
As in the previous example, the steps in the process will
varying from the first example (status
bar changes) in similar ways and the variations will be noted in red.
This example begins with the file behave4.htm , containing 4 different links in a bulleted list.
Select an object (tag). For example, select the
link "2388"
(Aside: If you want the new window to open but want the
original window to stay where it is, you will need to change the
links/anchors to be "null" by replacing them with a # .
Begin to select the action to take by clicking on the
Add Action Button
on the Behaviors
Panel. This will give a pop up/shortcut menu showing
the actions possible with this object (tag).
But first use the Show Events For> submenu will allow the selection of browser for which you wish to specify the behavior. Pick "4.0 and Later Browsers".
Continue to select the action. In this case, choose the Open Browser Window and make appropriate entries in the Open Browser Window Dialog Box and click on: OK.
The Behaviors Panel is now set to select the event which will complete this behavior specification. Note: In this case the event for this action is onClick (Also note the Show Events For> submenu. This allows for changing the choice of browser again at this point).
Save the file in behave5.htm.
Test the file with a Click and note the code in the <HEAD> section of the file as well as with the link in question.
Note also: The other links have been adjusted to show some other variations.
Checking Browsers...
Rollovers
Jump Menus and Jump Go Menus
Ready-Made Navigation Bars
Form Validation
We will
take a part of intro5.htm,
discussed above and add one more text field (for an e-mail address).
The initial file is behave6.htm
. The discussion below will only discuss validation of the e-mail
fields, but behave7.htm
will also contain validation (for non-empty) for the name.
As
in the previous example, the steps in the process will varying from the
first example (status
bar changes) in similar ways and the variations will be noted in red.
This example begins with the file behave6.htm , containing several form objects.
Select an object (tag). In this example it is essential to select the <form> tag, you should select the entire form.
Begin to select the action to take by clicking on the
Add Action Button
on the Behaviors
Panel. This will give a pop up/shortcut menu showing
the actions possible with this object (tag).
But first use the Show Events For> submenu will allow the selection of browser for which you wish to specify the behavior. Pick "4.0 and Later Browsers".
Continue to select the action. In this case, choose the Validate Form and make appropriate entries in the Validate Form Dialog Box , picking the appropriate text field, checking the "Value Required" check box and the Email Address radio button. Click on: OK.
The Behaviors Panel is now set to select the event which will complete this behavior specification. Note: In this case the event for this action is onSubmit (Also note the Show Events For> submenu. This allows for changing the choice of browser again at this point).
Save the file in behave7.htm.
Test the file with a Click and note the code in the <HEAD> section of the file as well as with the form in question.
We will be using two of the buttonswtsearch1.gif and buttonswtsearch2.gif, created with Microsoft Image Composer
Open a new file in Dreamweaver and save the file (File/Save As...) rollover1.htm . This will be necessary in order to complete what follows.
From the Menu Bar, click on Insert/Interactive Images>Rollover Image and when the Insert Rollover Image Dialog Box appears fill it in as shown in the previous link ( Insert Rollover Image Dialog Box), complete it as follows:
Image Name: swtsearch
Original Image: buttonswtsearch1.gif
Rollover Image: buttonswtsearch2.gif
Preload Rollover Image: Checked
When Clicked, Go To URL: http://www.mediasrv.swt.edu/pages/search.html
Save your work via File/Save (from the Menu Bar). A sample of the finished result can be seen in rollover1.htm .
Layers (Including Drag Layers)
Useful Panels/Inspector(s)
Although the Insert option on the Menu Bar will do much
of the required work, you might find it useful to have at least the following
panels (Recall, Window/... from the Menu Bar will obtain the
display of these panels):
Properties Inspector
Default Properties Inspector (Window/Properties)
Panels
Layers Panel (with "Prevent Overlays" checkbox off)
Drag Layers (finished result: layerex1.htm )
Save "empty file" as layerex1.htm. Some of the options used below require and existing file before continuing.
Modify/Page Properties... via Menu Bar ... set title (e.g. "Layers Example 1") and background file (bg.gif). Click on: OK .
Insert/Layer (Menu Bar) or via Objects
Panel -- (Common) and the Draw Layer Button
Sizing the layer (If default-sized layer is not opened, dragging a crosshairs cursor from lower right sets a panel size.)
Note selection of layer and moving via the handle
.
Having selected the layer, use the Properties Inspector (Layer) to name the layer with ID "monkey"
Place cursor inside the layer, Insert/Image via Menu Bar [or via the Objects Panel -- (Common) and the Insert Image Button], insert lilmonkey.gif .
Click outside the current layer, within the document. This will keep the next layer from being contained in the current layer. We are constructing these as separate layers.
In a manner similar to that shown above, insert and position a second layer and give it the ID, "crown" and insert the image, crown.gif . Note: The resulting Layers Panel .
To set the "destination" for this drag layer, move the "crown" layer on top of the head of the image in the "monkey" layer. Note: Arrow keys can be helpful with the final adjustments.
Select the image within the "crown"
layer and NOT the layer (Reason: We are about to set
the drag layer behavior and it need to be associated with the <img>
tag to which it will attach an <a> tag and not
set for the <div> tag) and click on the Add Action Button
in the Behaviors
Panel and choose Drag Layer from the choices available
in the shortcut menu . This will yield the
Drag Layer Dialog Box.
Notes:
Make Certain to pick the "crown" layer from the Layer Drop-Down list within the drag Layer Dialog Box.
Click the "Get Current Position" Button. This will help when the user gets close to the appropriate position. Click on: OK.
Move the "crown" layer away from the head position.
The Behaviors Panel should appear as shown in Behaviors Panel (Drag Layer). In particular the Event for the image should be chosen as (onMouseOver) if you select the image within the crown layer (Note: Make certain that the drag layer dialog box has the crown layer selected!!!).
Note: The events (Behaviors Panel) associated with the <a> and <img> HTML tags on the status bar as well as the Properties Inspector views associated with each of the tags. The (...) associated with the onMouseOver event and the <img> tag indicates that the <img> tag is a "child" of the "parent" <a> tag.
Save the file in layerex1.htm.
View the work in a browser and drag the crown near the top of the monkey's head.
Stuff for copy and paste throughout: