Documente Academic
Documente Profesional
Documente Cultură
SCM6814
Data Management 2
– Case insensitive
HTML Terminology
z Tags
– HTML codes that are in angle brackets (< and >)
– Tags come in two general types
– Container and empty tags.
z ELEMENTS
– Whose names appear between start tag and/or end tag
e.g. <element-name> and </element-name>
z attributes
– Elements may have associated properties, called attributes
z Containers
– which have both start tag and end tag
attribute
beginning tag content of container ending tag
z An empty tag
<HR align="CENTER" size="2" width="50">
attribute
empty tag
Necessary Tools
z ASCII Editor
– NotePad
z HTML Editor
– Dreamwaver/UltraDev (http://www.macromedia.com)
– Frontpage/InterDev (http://www.microsoft.com)
z JavaScript Editor
– ScriptBuilder (http://www.netobjects.com)
z Browsers
– Internet Explorer (http://www.microsoft.com)
– Netscape (http://www.netscape.com)
HTML template
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<HTML dir="LTR" lang="en">
<!-- comments -->
<HEAD>
<META http-equiv="refresh"
content="3;url=http://www.vu.edu.au">
<STYLE type="text/css">…</STYLE>
<SCRIPT language="JavaScript">…</SCRIPT>
<TITLE> …</TITLE>
</HEAD>
<BODY>
…document body…
</BODY>
</HTML>
10
HTML Headings
<H1>…</H1> Heading 1
<H2>…</H2> Heading 2
<H3>…</H3> Heading 3
<H4>…</H4> Heading 4
<H5>…</H5> Heading 5
<H6>…</H6> Heading 6
11
Character Formatting
<EM>…</EM> Emphasis
<STRONG>…</STRONG> Strong
<CODE>…</CODE> i = i + 1;
<B>…</B> Bold
<I>…</I> Italic
<TT>…</TT> Typewriter
12
13
14
Tables
<TABLE>…</TABLE> a table
<CAPTION>…</CAPTION> caption for the table
<TR>…</TR> table row
<TH>…</TH> table headers
<TD>…</TD> table data cell
<THEAD>…</THEAD> scrolling area of a table
<TFOOT>…</TFOOT> above the scrolling body
<TBODY>…</TBODY> below the scrolling body
<COLGROUP> combing a group of columns
<COL> specifications for one more columns
15
TABLE element
Attributes:
id,class,lang,dir,title,align
Style, inline style information
bgcolor background color
summary, summary of the table
Width, table width
frame, rules, border borders and rules
cellspacing, cellpadding cell margins
onClick, ondblClick, onMouseDown, intrinsic events
onMouseUp, onmouseover, "
onMouseMove, onMouseOut, "
onKeyPress, onKeyDown, onKeyUp "
16
A 3x3 Table
17
z style
– Property:border-color, float, padding
– Usage: <TABLE style="proerty1:value1;property2:value2">
– Note: padding replaces cellpadding and measurement units are px, mm,
cm and in.
z width
– Usage: <TABLE width="50%"> or
– <TABLE width="200"> or
– <TABLE width=“*">
18
19
20
<html>
<head><title>Table Menubar</title></head>
<body leftmargin="0" topmargin="0">
<!-- table_menu1.htm -->
<TABLE border="0" align="RIGHT" bgcolor="#00FF00" width="100%">
<TR><TH width="100">Home</TH>
<TH width="100">About Us</TH>
<TH width="100">Contact Us</TH>
<!-- three white spaces -->
<TH>   </TH>
<TH width="100">Member Login</TH>
</TR>
</TABLE>
</body>
</html>
21
Browser-Safe Palette
These are the Hexadecimal codes for the 216 colors that
will not be dithered in any standard browser. The codes are
made up of 3 hexadecimal values with each value being
two digits long. The first Hex value is for Red, the second
for Green and the third for Blue.
22
23
onMouseOut
24
MULTIMEDIA
z "A picture is worth a thousand words" is certainly an
understatement in the world of the Web. Here a picture is
worth many thousands of words, at least in terms of how
much space/memory a picture takes.
z An image comes with many different formats such as
GIF, JPEG, PNG, PDF, TIFF, BMP, PCX. The first two
are commonly used for web pages.
z Multimedia is a combination of text, graphical art, sound,
animation and video.
25
26
27
IMG Element
Attributes:
src, the image source
alt, text-based description
width, height, image size
hspace, vspace, space around image
ismap, server-side image map
usemap, client-side image map
align,border,class,dir,
id,lang,longdesc,
onClick, onDblClick, onKeyDown,
onKeyPress, onKeyUp, onMouseDown,
onMouseMove, onMouseOut,
onMouseOver, onMouseUp,
style,title
28
Note: The download time for the image will be the same regardless of
the display size.
29
elements:
IMG contains a src attribute specifying the name of the image
file and a name attribute specifying the name of the
<MAP>…</MAP> tag pair.
MAP
contains the name attribute used by <IMG>
30
Pixel Reference
x=0, y=0
x=300, y=80
400x400
x=50, y=350
x=400, y=400
31
AREA Element
attributes:
coords The coordinates of the shape in pixels. The coordinates
you enter depend on the shape you specify with the
shape attribute.
href
The URL associated with the area
name
the name of the area
nohref
Not to be associated with a URL
shape
the shape of the defined region such as
zrect: left-x, top-y, right-x, bottom-y
zcircle: center-x, center-y, radius
zpoly: x1, y1, x2, y2, ..., xN-1, yN-1,x1,y1
32
Australian Map
33
</MAP>
34
Audio
Audio files can be found in several different formats.
Usually each format requires a different plug-in, so it is
a good idea to limit the format of the sound. MPEG3
(.mp3) audio compression is now available to deliver
CD-quality sound files at much smaller file size.
z link
<A href="AuAnthem.mp3">Australian National
Anthem</A>
z embed
<EMBED src="AuAnthem.mp3" WIDTH=200 HEIGHT=200
AUTOSTART="false" ALIGN=center>
35
Video
z embed
<EMBED src="clock.avi" WIDTH=200 HEIGHT=200
AUTOSTART="false" ALIGN=center>
z link
<A href="sample.mov" WIDTH=200 HEIGHT=200
ALIGN=center>Quick Time Sample</A>
36
Frames
Using frames to divide a web page into smaller "pagelets"
is a popular way to control the layout of the screen. A
standard document has one HEAD section and one BODY.
A frameset document has a HEAD, and a FRAMESET in
place of the BODY.
elements:
FRAMESET specifies the layout of views in the main window
37
FRAMESET Element
attributes:
cols, together rows and cols define how many frames are
on the screen
rows,
The example divides the screen vertically in two
(i.e., creates a top half and a bottom half).
<FRAMESET rows="50%, 50%"> ...the rest of the
definition... </FRAMESET>
38
FRAME Element
attributes:
name, assigns a name to the current frame (target for other
links)
src, specifies the initial contents to be contained in the
frame
noresize, if present, frame window will not be resizable
39
FRAMs Demo
40
FRAMs Demo1
41
42
43
44
Special Targets
z _self
if an anchor tag (<A>) does not specify a target value, the _self target is the
default target.
z _parent
The _parent target causes the document to be loaded into the parent window,
which is the window containing the frameset that has the actual hypertext
reference.
z _top
it causes the browser to load the documents into a window without any
frames.
z _blank
To initiate a newly opened window, the browser uses the _blank target.
There is no real use for most Web weavers.
45
46
Form-Related Elements
47
A Contact Us Form
48
A Simple Form
<FORM action="mailto:s6666666@vu.edu.au?Subject=A
HTML email test "
method="POST">
Your name:<BR>
<INPUT type="TEXT" name="name"size="30"
MAXsize="80"><BR>
E-Mail address:<BR>
<INPUT type="TEXT" name="email" size="30"
MAXsize=80<BR>
49
mailto:
mailto: someone@microsoft.com
mailto: someone@microsoft.com?Subject=Subject of
Message&CC=others@ microsoft.com
mailto: someone@microsoft.com;
someone1@microsoft.com?subject=Subject of Message
50
51
name=Hao+Shi&email=s6666666@vu.edu.au
space ampersands
A name-pair in a HTTP request takes the form: name=value. The
ampersand (&) character delimits the name-value pairs. Note
some special characters are encoded by their hexadecimal value
%hex (% is prefix) or represented as other ASCII characters.
52
FORM Element
attributes:
action, specifies a form processing agent.
method, GET (restrict to ASCII) or POST
onReset, clear the user's input
onSubmit, client-side user input validation on submission
direct return data form to a target (window)
target,
accept-charset,
class,dir,encyte,id,
lang, name, onClick,
onDblClick, onKeyDown,
onKeyPress, onKeyUp,
onMouseDown, onMouseMove,
onMouseOut, onMouseOver,
onMouseUp, style, and title
53
54
55
Enctype Attribute
The enctype attribute of the FORM element specifies the
content type used to encode the form data set for submission to
the server (when the value of method is "POST"). The default
value for this attribute is "application/x-www-form-urlencoded".
The value "multipart/form-data" should be used in combination
with the INPUT element, type="file".
56
class, cols,
dir,disabled,id,lang,
onBlur,
onChange,onFocus,onSelect,
onClick, onDblClick,
onKeyDown, onKeyPress,
onKeyUp, onMouseDown,
onMouseMove, onMouseOut,
onMouseOver, onMouseUp,
readonly,style,tabindex,
title, wrap
57
SELECT Element
attributes:
size, visible options shown
multiple, allows multi-selection
58
OPTION Element
(sub-element of SELECT element)
attributes:
value, option value
selected, pre-selected options
class, cols,
dir,disabled,id,lang, onBlur,
onChange,onFocus,onSelect,
onClick, onDblClick, onKeyDown,
onKeyPress, onKeyUp,
onMouseDown, onMouseMove,
onMouseOut, onMouseOver,
onMouseUp, onSelect,style, and
title
59
BUTTON Element
attributes:
class, cols, a more sophisticated set than
dir,disabled,id,lang, <INPUT type="BUTTON">
name,onBlur,
onChange,onFocus,onSelect,
onClick, onDblClick,
onKeyDown, onKeyPress,
onKeyUp, onMouseDown,
onMouseMove, onMouseOut,
onMouseOver, onMouseUp,
onRest, onSubmit,style,
title, type and value
60
ASPCourse\Module1\demo1\app_form.htm
SCM6814 Data Management 2 © Hao Shi 2003 Lecture 1 – HTML
61
Appform.htm - FORM
• FORM
<FORM
action="mailto:s6666666@vu.edu.au?Online
Membership Application"
enctype="text/plain"
name="Form1"
method="POST">
...
</FORM>
62
Appform.htm - TEXT
• TEXT
<TR>
<TD align="RIGHT">First Name:</TD>
<TD>
<INPUT type="TEXT" name="firstname" size="20"
MAXsize=“20">
Last Name:
<INPUT type="TEXT" name="lastname" size="20"
MAXsize=“20"></TD>
</TR>
<TR><TD align="RIGHT">E-Mail address:</TD>
<TD><INPUT type="TEXT" name="email" size="50"
MAXsize=80><TD>
</TR>
63
• RADIO Button
<TR><TD align="RIGHT">Gender:</TD>
<TD>
<INPUT type="RADIO" name="gender" value="M">Male
<INPUT type="RADIO" name="gender" value="F">Female
</TD>
</TR>
64
Appform.htm - CHECKBOX
• CHECKBOX
<TR>
<TD align="RIGHT">Hobbies:</TD><TD>
<INPUT type=CHECKBOX name="hobby1"
value="basketball"> Basketball
<INPUT type=CHECKBOX name="hobby2"
value="golf"> Golf
<INPUT type=CHECKBOX name="hobby3" value="swimming">
Swimming
<INPUT type=CHECKBOX name="hobby4" value="tennis" >
Tennis
</TD>
</TR>
65
Appform.htm - SELECT
• SELECT
<TR>
<TD align="RIGHT">Occupation:</TD>
<TD>
<SELECT name="occupation">
<OPTION value="">[SELECT occupation]</OPTION>
<OPTION value="executive">executive</OPTION>
<OPTION value="professional">professional</OPTION>
<OPTION value="academic">academic</OPTION>
<OPTION value="technician">technician</OPTION>
<OPTION value="other">other</OPTION>
</SELECT>
</TD>
</TR>
66
Appform.htm - TEXTAREA
• TEXTAREA
<TR>
<TD align="RIGHT">Message:</TD>
<TD>
<TEXTAREA name="message" cols="50" rows="2">
</TEXTAREA>
<TD>
<TR>
<TR>
67
68
Development Tools
Web = HTML + Scripting + Components
Component
VC++,VJ++,VB Components Developer
ActiveX(COM)
Commercial
System Services Professional
Developer
Complex Win32
69
Lab1
Design a Web Site for a Club
z Visit http://www.staff.vu.edu.au/haoshi/scm6814/lab1
– Familiarize yourself with the prepared files in the directories