|

|
|
|
Dynamic HTML (DHTML) is the general term for a suite of HTML features
available in the 4.0 and later web browsers. These features enable
the web designer to control the web page layout and formatting, to a
greater degree than was possible with previous versions of HTML. This
control includes:
- The definition of formatting styles that can be applied anywhere
in a web site
- When a style is updated, the changes take affect throughout the web
site
- Elements on the web page can be positioned with pixel accuracy on
the page
- Elements on the web page can be hidden and shown interactively
- Elements on the web page can be animated
|
|
|
Cascading Style Sheets (CSS) are definitions that can
revise the style of an existing tag, or define a new style that can be
applied to other tags, with complete control over text format. A style
sheet can be inside a web page, or it can be an external file which all
the pages in a web site link to. This linking is very powerful, because
it enables the web designer to revise the external style sheet and see
the changes automatically reflected across the entire site.
|
|
|
Layers are boxes that can be positioned anywhere on the page, and contain
anything that can be put in a normal web page. Layers can
- Be positioned with pixel accuracy, in relation to the upper left
hand corner of the web page, or in relation to another layer.
- Contain anything, including text, links, gifs, animated gifs, and
jpegs.
- Have a stacking order, so that elements in a layer can be in front
of, or behind elements in another layer.
- Can be shown or hidden.
- Can have their position changed over time.
|
|
|
JavaScript is a programming language that is interpreted by the browser.
This language can control elements on the page, and respond interactively
to the user. JavaScript is a computer programming language, and is beyond
the scope of this course. Fortunately, applications like Dreamweaver
can automatically write JavaScript for you. Some things that can be done
with JavaScript are:
- Perform rollover image replacement for buttons.
- Validate data being entered in a form, before the form is sent to
the server.
- Show and hide layers.
- Animate layers
|
|
|
|
|
Cascading Style Sheets (CSS) are part of DHTML
(Dynamic HTML) introduced in the 4.0 browsers. They enable the web designer
to create text styles with characteristics such as font, size, and color.
For example, the following text is enclosed in a new style class called "coolstyle" which
has the following characteristics defined: font, size, bold, text color,
border, background color, and underline.
Some text that's inside my new coolstyle style
Another example is on this
page, which shows how the <A> tag for links has been redefined
using css to have no underline.
|
|
|
Cascading Style Sheets are style definitions that can revise the style
of an existing tag, or define a new style that can be applied to other
tags, with complete control over text format. A style sheet can be inside
a web page, or it can be an external file which all the pages in a web
site link to. This linking is very powerful, because it enables the web
designer to revise the external style sheet and see the changes automatically
reflected across the entire site.
- Styles Sheets can redefine existing tags. For example, the <p> tag
could be made to use the Trebuchet font with a 12 pixel height (this
is the case for the paragraphs on this page).
- Style Sheets can define new styles which can be applied to any text
selection. This is the case with the <span class="coolstyle"> tag
above, where the font, text color, background color, and underline
are defined with a single style.
- The attributes of Style Sheets goes beyond the normal styling of
HTML to include line height, leading, indent, background color or image
for the styled selection, text weight, borders, and even page breaks
for printing (but not all of these features are supported in all browsers).
- Many of the styles defined in the CSS1 specification are not displayed
properly inside Dreamweaver, and must be viewed in Netscape or Explorer.
- And of course, several of the style attributes display differently
in Netscape and Explorer, or do not display at all in any browser.
|
|
|
The definition in the <head> section for coolstyle is:
< style type="text/css">
< !--
.coolstyle {
font-family: "Courier New", Courier, mono;
font-style: italic;
font-weight: bold;
text-decoration: underline;
background-color: #CCCCCC;
padding: 0px;
border: 1px dotted #000000;
font-size: 16px;
color: #663300;
}
-->
< /style>
One method for applying the style to text is:
<span class="coolstyle">text to be
be styled</span>
|
|
- Select TEXT>CSS STYLES>NEW...
- To create a linked style style sheet in an external file, do the
following, otherwise, skip to number 3 below
- Select DEFINE IN... (NEW STYLE SHEET). When you say OKAY, you
will be taken to a file dialog where you will define the external
style sheet. Name this file with a ".css" suffix.
- OR, select DEFINE IN...THIS DOCUMENT ONLY
- To redefine an existing tag, select REDEFINE HTML TAG, and
select the tag from the pull down menu
- To create a new tag, select MAKE CUSTOM STYLE, and give the
new tag a name using the following rules:
- it should begin with a period
- the case of the characters is ignored
- it can contain only the characters A-Z, a-z, 0-9, and the dash "-"
- the underscore "_" and space " " characters
are not allowed
- style names not following these rules will be ignored in some
browsers
- for more information see http://www.w3.org/TR/REC-CSS2/syndata.html#q4
- Select OK, and a dialog box will open with a series of formatting
settings for TYPE, BACKGROUND, BOX, BORDER, etc. More information about
each of these Style Definitions is available in the Dreamweaver Help.
- Use the APPLY button to see how your style will look in your document
(assuming the style is already applied somewhere)
- Select OK from the Styles dialog box
- Select SAVE if you are editing an external style sheet, or select
DONE to complete the editing process
|
|
- If you've modified a standard HTML tag with a new style, the style
will automatically apply, and there is nothing to do beyond setting
that tag in the normal way.
- If you've created a new style, then it will now be available in the
property inspector under the STYLE pull-down. To apply the style, select
the text you want in that style and pull down the the style and pick
the one you want.
- To Edit a style that you've made, open the CSS Styles palette, and
select the style you want to edit, and click on the pencil icon at
the bottom right of the palette.
Note: CSS styles may not apply as expected to text inside of
tables. You should preview in both Netscape and Explorer to verify that
the text is formatting correctly. If not, you may have to apply the style
to the table or the text within the table.
|
|
Many websites now use links that display no underline, but when the
user rolls over the link, the underline shows. This is achieved using
the "hover" feature of CSS.
- Select TEXT>CSS STYLES>NEW...
- Redefine the A tag to have Text Decoration set to None
- Then TEXT>CSS STYLES>NEW... again
- Select ADVANCED
- Select SELECTOR>a:hover
- Select OK and then select text decoration>underline or whatever
changes you want in the hover state.
An interesting alternative to the underline is to set the hover state
to have a dotted underline. To do this, follow the above instructions
but don't use text decoration>underline,
instead:
- Go to the BORDER section
- Uncheck all the SAME FOR ALL
- Set the bottom border style to dotted, width 1 pixel, and color to
your choice.
|
|
|
Create a simple two page web site that has an external style sheet,
and uses the CSS styles in both web pages.
- Create two pages with a variety of text: headers, body text, links,
etc.
- The first page should be a menu page for your account on the Academy
web site.
- The second page should be a simple resume.
- Create a new external style sheet with a suffix of ".css"
- Modify some standard HTML tags, e.g. change the <a> tag to
create links without any underlines.
- Create some new css styles
- Be sure both pages are linked to the external style sheet
- Apply the styles to text within the pages
- Preview the pages in browsers
- Then change the styles to in the style sheet, and preview in a browser
to verify that both pages update with the new styles
- Upload the web site to your account on the Academy server. Don't
forget to upload the external CSS file as well.
|
|