SlideShare a Scribd company logo
1
Introduction to
HTML
Faculty Name:
Dr. Narinder Kaur
Static Pages / Dynamic Pages
A static website is a group of self-contained,
individual pages (or page), sent to the browser from
the server one-page-at-a-time.
SERVER
page.html page.html page.html
Dyamic web content is built when it is requested, by
the user directly, or programmatically while a user is
on a page (e.g., facebook updates).
Most websites contain both static and dynamic
elements.
SERVER page.html
SQL databases
.net
HTML
Client-side (front-end) coding includes HTML, CSS
and Javascript. This just means that our code will be
downloaded from the server and then compiled
entirely in the browser.
SERVER
page.html
.asp
SQL
etc
.net
BROWSER
style.css
script.js
Three layers of web design:
Structure, Style, Behavior
HTML, CSS, Javascript
STRUCTURE
HTML markup
Site planning
PRESENTATION
CSS
Imagery
BEHAVIOR
Javascript
INTRODUCTION OF HTML
• HTML is a language for describing web pages.
• HTML stands for Hyper Text Markup Language
• HTML is not a programming language, it is
a markup language
• A markup language is a set of markup tags
• HTML uses markup tags to describe web pages
OBJECTIVES OF HTML
• create, save and view a HTML document
• format a web page using section heading
tags
• describe Ordered and Unordered lists
• explain graphics in HTML document
• describe hypertext links and making
text/image link
ADVANTAGES OF HTML
• Easy to use
• Loose syntax (although, being too flexible will not
comply with standards).
• Supported on almost every browser, if not all
browsers.
• Widely used; established on almost every website, if
not all websites.
• Very similar to XML syntax, which is increasingly
used for data storage.
• Free - You need not buy any software.
• Easy to learn & code even for novice programmers.
DISADVANTAGES OF HTML
• It cannot produce dynamic output alone, since it is a static
language
• Sometimes, the structuring of HTML documents is hard to
grasp
• You have to keep up with deprecated tags, and make sure not
to use them
• Deprecated tags appear because another language that works
with HTML has replaced the original work of the tag; thus the
other language needs to be learned (most of the time, it is CSS)
• Security features offered by HTML are limited
12
Tags
 Codes enclosed in brackets
 Usually paired
<TITLE>My Web Page</TITLE>
 Not case sensitive
<TITLE> = <title> = <Title>
13
Creating a Basic Starting
Document
<HTML>
<HEAD>
<TITLE>Tecnia Institute </TITLE>
</HEAD>
<BODY>
This is what is displayed.
</BODY>
</HTML>
14
Color Codes
• Colors are set using “RGB” color codes,
which are, represented as hexadecimal
values. Each 2-digit section of the code
represents the amount, in sequence, of
red, green or blue that forms the color. For
example, a RGB value with 00 as the first
two digits has no red in the color.
15
Main Colours
16
RGB Colour Model
17
16 Basic Colors
18
Color Codes
1. WHITE
2. BLACK
3. RED
4. GREEN
5. BLUE
6. MAGENTA
7. CYAN
8. YELLOW
9. AQUAMARINE
10. BAKER’S CHOCOLATE
11. VIOLET
12. BRASS
13. COPPER
14. PINK
15. ORANGE
1. #FFFFFF
2. #000000
3. #FF0000
4. #00FF00
5. #0000FF
6. #FF00FF
7. #00FFFF
8. #FFFF00
9. #70DB93
10. #5C3317
11. #9F5F9F
12. #B5A642
13. #B87333
14. #FF6EC7
15. #FF7F00
19
The Body Element
• The BODY element of a web page is an important
element in regards to the page’s appearance. Here are
the attributes of the BODY tag to control all the levels:
TEXT="#RRGGBB" to change the color of all the text
on the page (full page text color.)
 This element contains information about the page’s
background color, the background image, as well as the
text and link colors.
20
Background Color
 It is very common to see web pages with their
background color set to white or some other colors.
 To set your document’s background color, you need to
edit the <BODY> element by adding the BGCOLOR
attribute. The following example will display a document
with a white background color:
<BODY BGCOLOR=“#FFFFFF”></BODY>
21
TEXT Color
 The TEXT attribute is used to control the color of all
the normal text in the document. The default color for
text is black. The TEXT attribute would be added as
follows:
<BODY BGCOLOR=“#FFFFFF”
TEXT=“#FF0000”></BODY>
In this example the document’s page
color is white and the text would be red.
22
LINK, VLINK, and ALINK
These attributes control the colors of the different link states:
1. LINK – initial appearance – default = Blue.
2. VLINK – visited link – default = Purple.
3. ALINK –active link being clicked–default= Yellow.
The Format for setting these attributes is:
<BODY BGCOLOR=“#FFFFFF” TEXT=“#FF0000”
LINK=“#0000FF”
VLINK=“#FF00FF”
ALINK=“FFFF00”> </BODY>
23
Using Image Background
 The BODY element also gives you ability of
setting an image as the document’s
background.
 An example of a background image’s HTML
code is as follows:
<BODY BACKGROUND=“hi.gif”
BGCOLOR=“#FFFFFF”></BODY>
24
Headings, <Hx> </Hx>
<HTML>
<HEAD>
<TITLE> Example Page</TITLE>
</HEAD>
<BODY>
<H1> Heading 1 </H1>
<H2> Heading 2 </H2>
<H3> Heading 3 </H3>
<H4> Heading 4 </H4>
<H5> Heading 5 </H5>
<H6> Heading 6 </H6>
</BODY>
</HTML>
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
25
Paragraphs, <P> </P>
<HTML><HEAD>
<TITLE> Example Page</TITLE>
</HEAD>
<BODY></H1> Heading 1 </H1>
<P> Paragraph 1, ….</P>
<H2> Heading 2 </H2>
<P> Paragraph 2, ….</P>
<H3> Heading 3 </H3>
<P> Paragraph 3, ….</P>
<H4> Heading 4 </H4>
<P> Paragraph 4, ….</P>
<H5> Heading 5 </H5>
<P> Paragraph 5, ….</P>
<H6> Heading 6</H6>
<P> Paragraph 6, ….</P>
</BODY></HTML>
Heading 1
Paragraph 1,….
Heading 2
Paragraph 2,….
Heading 3
Paragraph 3,….
Heading 4
Paragraph 4,….
Heading 5
Paragraph 5,….
Heading 6
Paragraph 6,….
26
Break, <BR>
 Line breaks allow you to decide where the text
will break on a line or continue to the end of the
window.
 A <BR> is an empty Element, meaning that it
may contain attributes but it does not contain
content.
 The <BR> element does not have a closing tag.
27
Break, <BR>
<HTML>
<HEAD>
<TITLE> Example Page</TITLE>
</HEAD>
<BODY>
<H1> Heading 1 </H1>
<P>Paragraph 1, <BR>
Line 2 <BR> Line 3 <BR>….
</P>
</BODY>
</HTML>
Heading 1
Paragraph 1,….
Line 2
Line 3
….
28
Horizontal Rule, <HR>
 The <HR> element causes the
browser to display a horizontal
line (rule) in your document.
 <HR> does not use a closing tag,
</HR>.
29
Horizontal Rule, <HR>
Attribute Description Default Value
SIZE
Height of the rule in
pixels
2 pixels
WIDTH
Width of the rule in
pixels or percentage
of screen width
100%
NOSHADE
Draw the rule with a
flat look instead of a
3D look
Not set
(3D look)
ALIGN
Aligns the line (Left,
Center, Right)
Center
COLOR
Sets a color for the
rule (IE 3.0 or later)
Not set
30
Horizontal Rule, <HR>
<HTML>
<HEAD>
<TITLE> Example Page</TITLE>
</HEAD>
<BODY>
<H1> Heading 1 </H1>
<P>Paragraph 1, <BR>
Line 2 <BR>
<HR>Line 3 <BR>
</P>
</BODY>
</HTML>
Heading 1
Paragraph 1,….
Line 2
______________________
_____
Line 3
31
Character Formatting
How to enhance your page with Bold, Italics, and other
character formatting options.
1. Change the color and size of your text.
2. Use Common Character Formatting Elements.
3. Align your text.
4. Add special characters.
5. Use other character formatting elements.
32
Bold, Italic and other Character Formatting
Elements
 <FONT SIZE=“+2”> Two sizes bigger</FONT>
 The size attribute can be set as an absolute value from 1 to 7 or as a
relative value using the “+” or “-” sign. Normal text size is 3 (from -2 to +4).
 <B> Bold </B>
 <I> Italic </I>
 <U> Underline </U>
 Color = “#RRGGBB” The COLOR attribute of the FONT element. E.g.,
<FONT COLOR=“#RRGGBB”>this text has color</FONT>
 <PRE> Preformatted </PRE> Text enclosed by PRE tags is displayed in
a mono-spaced font. Spaces and line breaks are supported without
additional elements or special characters.
33
Bold, Italic and other Character Formatting
Elements
<P> <FONT SIZE=“+1”> One Size
Larger </FONT> - Normal –
<FONT SIZE=“-1”> One Size
Smaller </FONT>
<BR>
<B> Bold</B> - <I> italics</I> - <U>
Underlined </U> -
<FONT COLOR=“#FF0000”>
Colored </FONT>
<BR>
<EM> Emphasized</EM> -
<STRONG> Strong </STRONG>
- <TT> Tele Type </TT> <BR>
One Size Larger - Normal – One
Size Smaller
Bold - italics - Underlined -
Colored
Emphasized - Strong - Tele
Type
34
Alignment
 Some elements have attributes for
alignment (ALIGN) e.g. Headings,
Paragraphs and Horizontal Rules.
 The Three alignment values are : LEFT,
RIGHT, CENTER.
 <CENTER></CENTER> Will center
elements.
35
Alignment
 <DIV ALIGN=“value”></DIV> Represents
a division in the document and can contain
most other element type. The alignment
attribute of the DIV element is well
supported.
 <TABLE></TABLE> Inside a TABLE,
alignment can be set for each individual
cell.
36
Additional Character Formatting Elements
 <STRIKE> strike-through text</STRIKE>
DEL is used for STRIKE at the latest browsers
 <BIG> places text in a big font</BIG>
 <SMALL> places text in a small font</SMALL>
 <SUB> places text in subscript position </SUB>
 <SUP> places text in superscript style position </SUP>
37
Lists
In this chapter you will learn how to create a variety of lists.
Objectives
Upon completing this section, you should be able to
1. Create an unordered list.
2. Create an ordered list.
3. Create a defined list.
4. Nest Lists.
38
List Elements
 HTML supplies several list elements. Most list elements
are composed of one or more <LI> (List Item) elements.
 UL : Unordered List. Items in this list start with a list mark
such as a bullet. Browsers will usually change the list
mark in nested lists.
<UL>
<LI> List item …</LI>
<LI> List item …</LI>
</UL>
• List item …
• List item …
39
List Elements
 You have the choice of three bullet types: disc(default), circle,
square.
 These are controlled in Netscape Navigator by the “TYPE” attribute
for the <UL> element.
<UL TYPE=“square”>
<LI> List item …</LI>
<LI> List item …</LI>
<LI> List item …</LI>
</UL>
 List item …
 List item …
 List item …
40
List Elements
 OL: Ordered List. Items in this list are numbered
automatically by the browser.
<OL type=“A”>
<LI> List item …</LI>
<LI> List item …</LI>
<LI> List item …</LI>
</OL>
A. List item …
B. List item …
C. List item
 You have the choice of setting the TYPE Attribute to
one of five numbering styles.
41
List Elements
TYPE Numbering Styles
1 Arabic numbers 1,2,3, ……
a Lower alpha a, b, c, ……
A Upper alpha A, B, C, ……
i Lower roman i, ii, iii, ……
I Upper roman I, II, III, ……
42
Images
 <IMG>This element defines a graphic image on the page.
 Image File (SRC:source): This value will be a URL (location of
the image) E.g. http://www.domain.com/dir/file.ext or /dir/file.txt.
 Alternate Text (ALT): This is a text field that describes an image
or acts as a label. It is displayed when they position the cursor
over a graphic image.
 Alignment (ALIGN): This allows you to align the image on your
page.
43
Images
 Width (WIDTH): is the width of the image in pixels.
 Height (HEIGHT): is the height of the image in pixels.
 Border (BORDER): is for a border around the image, specified
in pixels.
 HSPACE: is for Horizontal Space on both sides of the image
specified in pixels. A setting of 5 will put 5 pixels of invisible
space on both sides of the image.
 VSPACE: is for Vertical Space on top and bottom of the image
specified in pixels. A setting of 5 will put 5 pixels of invisible
space above and bellow the image.
44
Some Examples on images
1) <IMG SRC=“jordan.gif“ border=4>
2) <IMG SRC=" jordan.gif" width="60" height="60">
3) <IMG SRC=“jordan.gif" ALT="This is a text that goes with the
image">
4) <IMG SRC=" jordan.gif “ Hspace="30" Vspace="10" border=20
5) < IMG SRC =" jordan.gif“ align="left">
blast blast blast blast blast
45
HOW TO MAKE A LINK
1) The tags used to produce links are the <A> and </A>. The <A> tells
where the link should start and the </A> indicates where the link
ends.
Everything between these two will work as a link.
2) The example below shows how to make the word
Here work as a link to yahoo.
Click <A HREF="http://www.yahoo.com">here</A> to
go to yahoo.
46
Internal Links
 Internal Links : Links can also be created inside large documents to
simplify navigation. Today’s world wants to be able to get the
information quickly. Internal links can help you meet these goals.
1. Select some text at a place in the document that you would like to
create a link to, then add an anchor to link to like this:
<A NAME=“bookmark_name”></A>
The Name attribute of an anchor element specifies a location in the
document that we link to shortly. All NAME attributes in a document
must be unique.
2. Next select the text that you would like to create as a link to the location
created above.
<A HREF=“#bookmark_name”>Go To Book Mark</A>
47
Tables
 The <TABLE></TABLE> element has four
sub-elements:
1. Table Row<TR></TR>.
2. Table Header <TH></TH>.
3. Table Data <TD></TD>.
4. Caption <CAPTION></CAPTION>.
 The table row elements usually contain table
header elements or table data elements.
48
Tables
<table border=“1”>
<tr>
<th> Column 1 header </th>
<th> Column 2 header </th>
</tr>
<tr>
<td> Row1, Col1 </td>
<td> Row1, Col2 </td>
</tr>
<tr>
<td> Row2, Col1 </td>
<td> Row2, Col2 </td>
</tr>
</table>
49
Tables
Column 1 Header Column 2 Header
Row1, Col1 Row1, Col2
Row2, Col1 Row2, Col2
50
Tables Attributes
 BGColor: Some browsers support background colors in a table.
 Width: you can specify the table width as an absolute number of pixels
or a percentage of the document width. You can set the width for the
table cells as well.
 Border: You can choose a numerical value for the border width, which
specifies the border in pixels.
 CellSpacing: Cell Spacing represents the space between cells and is
specified in pixels.
 CellPadding: Cell Padding is the space between the cell border and
the cell contents and is specified in pixels.
 Align: tables can have left, right, or center alignment.
51
Table Caption
 A table caption allows you to specify a line of text that
will appear centered above or bellow the table.
<TABLE BORDER=1 CELLPADDING=2>
<CAPTION ALIGN=“BOTTOM”> Label For My Table </CAPTION>
 The Caption element has one attribute ALIGN that can
be either TOP (Above the table) or BOTTOM (below the
table).
52
Table Data and Table Header
Attributes
 Colspan: Specifies how many cell columns of the table this cell
should span.
 Rowspan: Specifies how many cell rows of the table this cell should
span.
 Align: cell data can have left, right, or center alignment.
 Valign: cell data can have top, middle, or bottom alignment.
 Width: you can specify the width as an absolute number of pixels or
a percentage of the document width.
 Height: You can specify the height as an absolute number of pixels
or a percentage of the document height.
53
<TABLE BORDER width=“750”>
<TR> <TD colspan=“4” align=“center”>Page
Banner</TD></TR>
<TR> <TD rowspan=“2” width=“25%”>Nav
Links</TD><TD colspan=“2”>Feature
Article</TD> <TD rowspan=“2”
width=“25%”>Linked Ads</TD></TR>
<TR><TD width=“25%”>News Column 1 </TD>
<TD width=“25%”><News Column 2 </TD></TR>
</TABLE>
What will be the output?
54
The Output
55
Frames
 Frames are a relatively new addition to the HTML
standard. First introduced in Netscape
Navigator 2.0.
Objectives:
Upon completing this section, you should be able to:
 Create a Frame based page.
 Work with the Frameset, Frame, and Noframes
elements.
 Use the attributes of the Frames elements to
control the display.
 Set Targets appropriately.
56
Frames
 A framed page is actually made up of multiple HTML pages.
There is one HTML document that describes how to break up
the single browser window into multiple windowpanes. Each
windowpane is filled with an HTML document.
 For Example to make a framed page with a windowpane on the
left and one on the right requires three HTML pages. Doc1.html
and Doc2.html are the pages that contain content.
Frames.html is the page that describes the division of the
single browser window into two windowpanes.
57
Frames
Doc2.html
Doc1.html
Frames.html
Doc2.html
Doc1.html
58
Frame Page Architecture
 A <FRAMESET> element is placed in the html document before the
<BODY> element. The <FRAMESET> describes the amount of screen
real estate given to each windowpane by dividing the screen into ROWS
or COLS.
 The <FRAMESET> will then contain <FRAME> elements, one per
division of the browser window.
 Note: Because there is no BODY container, FRAMESET pages can't
have background images and background colors associated with them.
59
Frame Page Architecture
<HTML>
<HEAD>
<TITLE> Framed Page </TITLE>
<FRAMeSET COLS=“23%,77%”>
<FRAME SRC=“Doc1.html”>
<FRAME SRC=“Doc2.html”>
</FRAMeSET >
</HEAD>
</HTML>
60
The Diagram below is a graphical view
of the document described above
FRAMESET COLS=”23%, 77%”
FRAME
NAME=right_pane
SRC= Doc2.html
FRAME
NAME=
left_pane
SRC=Doc1.h
tml
61
<FRAMESET> Container
<FRAMESET> : The FRAMESET element creates divisions in the
browser window in a single direction. This allows you to define
divisions as either rows or columns.
 ROWS : Determines the size and number of rectangular rows
within a <FRAMESET>. They are set from top of the display
area to the bottom.
Possible values are:
 Absolute pixel units, I.e. “360,120”.
 A percentage of screen height, e.g. “75%,25%”.
 Proportional values using the asterisk (*). This is often combined
with a value in pixels , e.g. “360,*”.
 <Frameset cols=“200,20%,*,2*”>
62
Creating a Frames Page
 COLS: Determines the size and number of rectangular
columns within a <FRAMESET>. They are set from left
to right of the display area.
Possible values are:
 Absolute pixel units, I.e. “480,160”.
 A percentage of screen width, e.g. “75%,25%”.
 Proportional values using the asterisk (*). This is often
combined with a value in pixels , e.g. “480,*”.
63
Attributes of <Frameset> tag
 FRAMEBORDER : Possible values 0, 1, YES, NO. A setting of
zero will create a borderless frame.
 FRAMESPACING: This attribute is specified in pixels. If you go
to borderless frames you will need to set this value to zero as
well, or you will have a gap between your frames where the
border used to be.
 BORDER(thickness of the Frame): This attribute specified in
pixels. A setting of zero will create a borderless frame. Default
value is 5.
 BORDERCOLOR: This attribute is allows you choose a color for
your border. This attribute is rarely used.
 ROWS
 COLS
64
<FRAME>
<FRAME>: This element defines a single frame within a
frameset. There will be a FRAME element for each
division created by the FRAMESET element. This tag
has the following attributes:
 SRC: Required, as it provides the URL for the page that
will be displayed in the frame.
 NAME: Required for frames that will allow targeting by
other HTML documents. Works in conjunction with the
target attribute of the <A>, <AREA>, <BASE>, and
<FORM> tags.
65
Attributes of <FRAME> tag
 MARGINWIDTH: Optional attribute stated in pixels.
Determines horizontal space between the <FRAME> contents
and the frame’s borders.
 MARGINHEIGHT: Optional attribute stated in pixels.
Determines vertical space between the <FRAME> contents
and the frame’s borders.
 SCROLLING: Displays a scroll bar(s) in the frame. Possible
values are:
1. Yes – always display scroll bar(s).
2. No – never display scroll bar(s).
3. Auto – browser will decide based on frame contents.
By default: scrolling is auto.
66
Frame Formatting
• Example:
<frameset rows=“20%, *, 20%” border=4>
<frame src=“header.html” noresize
scrolling=no>
<frame src=“body.html”>
<frame src=“navigationbar.html”
noresize scrolling=no>
</frameset>
67
Targets
 When you use links for use in a frames environment you will need to
specify an additional attribute called TARGET.
 The TARGET attribute uses the NAME attribute of the FRAME
element.
 If we were to place a link in doc1.html that linked to doc3.html and we
wanted doc3.html to be displayed in the right windowpane; the HTML
code would appear in doc1.html as follows:
<A HREF=“doc3.html” TARGET=“right_pane”>Link
to Document 3 </A>
68
Special Targets
• There are 4 special target names that cannot be assigned by the NAME
attribute of the FRAME tag.
1. TARGET=“_top” : This loads the linked document into the full browser
window with the URL specified by the HREF attribute. All frames
disappear, leaving the new linked page to occupy the entire window. The
back is turned on.
2. TARGET=“_blank” : Opens an unnamed new browser window and loads
the document specified in the URL attribute into the new window (and
your old window stays open). The back is turned off. Other windows
remains on.
3. TARGET=“_self” : Loads the document in the same window where the
anchor was {Clicked}. This is the default setting for linking elements.
4. TARGET=“_parent” : the _parent frame is a prior frameset that the
current frameset was “spawned” from. If there isn’t one it is the browser
window. The document is loaded into the area occupied by the columns
or rows frameset containing the frame that contains the link. The back is
turned on. All windows disappear.
69
If a frame contains the following link, then clicking the link launches a new,
unnamed browser display window that contains the content defined in
stuff.HTM. This can be a simple HTML document, or an entirely new
FRAMESET definition.
1. <A HREF="stuff.html" TARGET="_blank">
If a frame contains the following link, then clicking the link will simply cause the
frame which contains the link to clear, and its content will be replaced with
whatever is in stuff.htm.
2. <A HREF="stuff.html" TARGET="_self">
If a frame contains the following link, the frameset that contains the frame that
contains this link will be replaced by stuff.HTM.
3. <A HREF="stuff.html" TARGET="_parent">
Finally, if a frame contains the following link, clicking the link replaces the entire
browser window with the contents of stuff.HTM.
4. <A HREF="stuff.html" TARGET="_top">
70
Targeting links to frames
The TARGET attribute allows you to specify the frame into which a page
is to be loaded into in a frames setting.
<A HREF=“chap1.html” TARGET=“_self”> [Chapter 1]</A>
<A HREF=“chap1.html” TARGET=“_parent”> [Chapter 2]</A>
Parent window Learning HTML
[Chapter 1][Chapter 2][Chapter 3]
chap1.html
chap2.html
71
Targeting links to frames
The TARGET attribute allows you to specify the frame into which a
page is to be loaded into in a frames setting.
<A HREF=“chap1.html” TARGET=“bottom”> [Chapter 1]</A>
<A HREF=“chap2.html” TARGET=“bottom”> [Chapter 2]</A>
<A HREF=“chap3.html” TARGET=“bottom”> [Chapter 3]</A>
Learning HTML
[Chapter 1][Chapter 2][Chapter 3]
chap1.html
chap2.html
chap3.html
72
Forms
 Forms add the ability to web pages to not only provide the
person viewing the document with dynamic information but
also to obtain information from the person viewing it, and
process the information.
1. Create a FORM.
2. Add elements to a FORM.
3. Define CGI (Common Gateway Interface).
4. Describe the purpose of a CGI Application.
5. Specify an action for the FORM.
 Forms work in all browsers.
 Forms are Platform Independent.
73
Forms
 To insert a form we use the <FORM></FORM> tags. The rest of the form
elements must be inserted in between the form tags.
<HTML> <HEAD>
<TITLE> Sample Form</TITLE>
</HEAD>
<BODY BGCOLOR=“FFFFFF”>
<FORM ACTION = http://www.xnu.com/formtest.asp>
<P> First Name: <INPUT TYPE=“TEXT” NAME=“fname” MAXLENGTH=“50”>
</P>
<P> <INPUT TYPE=“SUBMIT” NAME=“fsubmit1” VALUE=“Send Info”> </P>
</FORM>
</BODY> </HTML>
74
<FORM> element attributes
 ACTION: is the URL of the CGI (Common Gateway Interface)
program that is going to accept the data from the form, process
it, and send a response back to the browser.
 METHOD: GET (default) or POST specifies which HTTP method
will be used to send the form’s contents to the web server. The
CGI application should be written to accept the data from either
method.
 NAME: is a form name used by VBScript or JavaScripts.
 TARGET: is the target frame where the response page will show
up.
75
Form Elements
 Form elements have properties: Text boxes,
Password boxes, Checkboxes, Option(Radio)
buttons, Submit, Reset, File, Hidden and Image.
 The properties are specified in the TYPE Attribute of
the HTML element <INPUT></INPUT>.
76
Sami Ali
Al al-Bayt University
77
Form Elements
<INPUT> Element’s Properties
TYPE= Type of INPUT entry field.
NAME = Variable name passed to CGI application
VALUE= The data associated with the variable
name to be passed to the CGI application
CHECKED= Button/box checked
SIZE= Number of visible characters in text field
MAXLENGHT= Maximum number of characters
accepted.
78
Text Box
 Text boxes: Used to provide input fields for text, phone numbers,
dates, etc.
<INPUT TYPE= " TEXT " >
Browser will display Textboxes use the following attributes:
 TYPE: text.
 SIZE: determines the size of the textbox in characters. Default=20
characters.
 MAXLENGHT : determines the maximum number of characters that
the field will accept.
 NAME: is the name of the variable to be sent to the CGI application.
 VALUE: will display its contents as the default value.
79
<TITLE>Form_Text_Type</TITLE>
</HEAD>
<BODY>
<h1> <font color=blue>Please enter the following bioData</font></h1>
<FORM name="fome1" Method= " get " Action= " URL " >
First Name: <INPUT TYPE="TEXT" NAME="FName"
SIZE="15" MAXLENGTH="25"><BR>
Last Name: <INPUT TYPE="TEXT" NAME="LName"
SIZE="15" MAXLENGTH="25"><BR>
Nationality: <INPUT TYPE="TEXT" NAME="Country"
SIZE="25" MAXLENGTH="25"><BR>
The Phone Number: <INPUT TYPE="TEXT" NAME="Phone"
SIZE="15" MAXLENGTH="12"><BR>
</FORM>
</BODY>
</HTML>
Example on Text Box
80
Output
81
 Password: Used to allow entry of passwords.
<INPUT TYPE= " PASSWORD " >
Browser will display
Text typed in a password box is starred out in the browser
display.
Password boxes use the following attributes:
 TYPE: password.
 SIZE: determines the size of the textbox in characters.
 MAXLENGHT: determines the maximum size of the password in
characters.
 NAME: is the name of the variable to be sent to the CGI application.
 VALUE: is usually blank.
Password
82
<HTML>
<HEAD>
<TITLE>Form_Password_Type</TITLE></HEAD>
<BODY>
<h1> <font color=red>To Access, Please enter:</font></h1>
<FORM name="fome2" Action="url" method="get">
User Name: <INPUT TYPE="TEXT" Name="Fname” SIZE="15"
MAXLENGTH="25"><BR>
Password: <INPUT TYPE="PASSWORD“ NAME="PWord" value=""
SIZE="15” MAXLENGTH="25"><BR>
</FORM>
</BODY>
</HTML>
Example on Password Box
83
Output
84
 Hidden: Used to send data to the CGI application that you don’t
want the web surfer to see, change or have to enter but is
necessary for the application to process the form correctly.
<INPUT TYPE=“HIDDEN”>
Nothing is displayed in the browser.
Hidden inputs have the following attributes:
 TYPE: hidden.
 NAME: is the name of the variable to be sent to the CGI
application.
 VALUE: is usually set a value expected by the CGI application.
Hidden
85
Check Box
 Check Box: Check boxes allow the users to select more than
one option.
<INPUT TYPE=“CHECKBOX”>
Browser will display
Checkboxes have the following attributes:
 TYPE: checkbox.
 CHECKED: is blank or CHECKED as the initial
status.
 NAME: is the name of the variable to be sent to the
CGI application.
 VALUE: is usually set to a value.
86
<HTML> <HEAD><TITLE>CheckBoxType</TITLE> </HEAD>
<BODY>
<h1>
<font color=green>Please check one of the following</font>
</h1>
<FORM name="forme" Action="url" method="get">
<font color=red> Select Country: </font><BR>
jordan:<INPUT TYPE="CheckBox" Name="country" CHECKED><BR>
Yemen<INPUT TYPE="CheckBox" Name="country"><BR>
Qatar:<INPUT TYPE="CheckBox" Name="country"><BR> <BR>
<font color=blue>Select Language:</font><BR>
Arabic:<INPUT TYPE="CheckBox" Name="language" CHECKED><BR>
English:<INPUT TYPE="CheckBox" Name="language"><BR>
French:<INPUT TYPE="CheckBox" Name="language"> <BR>
</FORM>
</BODY>
</HTML>
87
Output
88
 Radio Button: Radio buttons allow the users to select
only one option.
<INPUT TYPE=“RADIO”>
Browser will display
Radio buttons have the following attributes:
 TYPE: radio.
 CHECKED: is blank or CHECKED as the initial
status. Only one radio button can be
checked
 NAME: is the name of the variable to be sent to the
CGI application.
 VALUE: usually has a set value.
Radio Button
89
<HTML>
<HEAD><TITLE>CheckBoxType</TITLE> </HEAD>
<BODY>
<h1> <font color=green>Please check one of the following</font></h1>
<FORM name="fome3" Action="url" method="get">
<font color=red> Select Country: </font><BR>
jordan:<INPUT TYPE= "RADIO" Name="country" CHECKED><BR>
Yemen<INPUT TYPE="RADIO " Name="country"><BR>
Qatar:<INPUT TYPE="RADIO" Name="country"><BR> <BR>
<font color=blue>Select Language:</font><BR>
Arabic:<INPUT TYPE="RADIO" Name="language" CHECKED><BR>
English:<INPUT TYPE=" RADIO " Name="language"><BR>
French:<INPUT TYPE=" RADIO " Name="language"> <BR>
</FORM>
</BODY>
</HTML>
90
91
<HTML><HEAD>
<TITLE>RADIOBox</TITLE> </HEAD>
<BODY>
Form #1:
<FORM>
<INPUT TYPE="radio" NAME="choice" VALUE="one"> Yes.
<INPUT TYPE="radio" NAME="choice" VALUE="two"> No.
</FORM>
<HR color=red size="10" >
Form #2:
<FORM>
<INPUT TYPE="radio" NAME="choice" VALUE="three" CHECKED> Yes.
<INPUT TYPE="radio" NAME="choice" VALUE="four"> No.
</FORM>
</BODY
92
Output
93
 Push Button: This element would be used with
JavaScript to cause an action to take place.
<INPUT TYPE=“BUTTON”>
Browser will display
Push Button has the following attributes:
 TYPE: button.
 NAME: is the name of the button to be used
in scripting.
 VALUE: determines the text label on the button.
Push Button
94
<DIV align=center><BR><BR>
<FORM>
<FONT Color=red>
Press Here to see a baby crying:<BR>
<INPUT TYPE="button" VALUE="PressMe"><BR><BR>
<FONT Color=blue>
Click Here to see a baby shouting:<BR>
<INPUT TYPE="button" VALUE="ClickMe" > <BR><BR>
<FONT Color=green>
Hit Here to see a baby eating:<BR>
<INPUT TYPE="button" VALUE="HitME" > <BR><BR>
</FORM>
</DIV>
95
96
 Submit: Every set of Form tags requires a Submit button. This
is the element causes the browser to send the names and
values of the other elements to the CGI Application specified by
the ACTION attribute of the FORM element.
<INPUT TYPE=“SUBMIT”>
The browser will display
Submit has the following attributes:
 TYPE: submit.
 NAME: value used by the CGI script for processing.
 VALUE: determines the text label on the button, usually Submit
Query.
Submit Button
97
<FORM Action="URL" method="get">
First Name: <INPUT TYPE="TEXT" Size=25
name="firstName"><BR>
Family Name: <INPUT TYPE="TEXT" Size=25
name="LastName"><BR>
<BR>
<FONT Color=red>
Press Here to submit the data:<BR>
<INPUT TYPE="submit" VALUE="SubmitData " >
</FORM>
98
99
Reset Button
• Reset: It is a good idea to include one of these for
each form where users are entering data. It allows
the surfer to clear all the input in the form.
• <INPUT TYPE=“RESET”>
• Browser will display
•
• Reset buttons have the following attributes:
• TYPE: reset.
• VALUE: determines the text label on the button,
usually Reset.
100
<FORM Action="URL" method="get">
First Name: <INPUT TYPE="TEXT" Size=25 name="firstName">
<BR>
Family Name: <INPUT TYPE="TEXT" Size=25 name="LastName">
<BR>
<BR>
<FONT Color = red>
<STRONG><font size=5>Press Here to submit the data: </font>
</STRONG><BR>
<INPUT TYPE="submit" VALUE="SubmitData">
<INPUT TYPE="RESET" VALUE="Reset">
</FORM>
101
102
• File Upload: You can use a file upload to allow surfers to
upload files to your web server.
• <INPUT TYPE=“FILE”>
• Browser will display
• File Upload has the following attributes:
• TYPE: file.
• SIZE: is the size of the text box in characters.
• NAME: is the name of the variable to be sent to the
CGI application.
• MAXLENGHT: is the maximum size of the input in the
textbox in characters.
File
103
<BODY bgcolor=lightblue>
<form>
<H3><font color=forestgreen>
Please attach your file here for uploading
<font color =red>SERVER...<BR>
<INPUT TYPE="File" name="myFile"
size="30">
<INPUT TYPE="Submit" value="SubmitFile">
</form>
</BODY>
104
Other Elements used in Forms
 <TEXTAREA></TEXTAREA>: is an element
that allows for free form text entry.
Browser will display
Textarea has the following attributes:
 NAME: is the name of the variable to be sent
to the CGI application.
 ROWS: the number of rows to the textbox.
 COLS: the number of columns to the textbox.
105
<BODY bgcolor=lightblue>
<form>
<TEXTAREA COLS=40 ROWS=20
Name="comments" >
From observing the apathy of those about me during flag raising
I concluded that patriotism if not actually on the decline is at
least in a state of dormancy.
</TEXTAREA>:
</form>
</BODY>
106
107
Other Elements used in Forms
 The two following examples are
<SELECT></SELECT> elements, where the
attributes are set differently.
The Select elements attributes are:
 NAME: is the name of the variable to be sent to the
CGI application.
 SIZE: this sets the number of visible choices.
 MULTIPLE: the presence of this attribute signifies
that the user can make multiple selections. By default
only one selection is allowed.
108
Other Elements used in Forms
 Option
The list items are added to the <SELECT> element by
inserting <OPTION></OPTION> elements.
The Option Element’s attributes are:
 SELECTED: When this attribute is present, the
option is selected when the document is initially
loaded. It is an error for more than one option to
be selected.
 VALUE: Specifies the value the variable named in
the select element.
109
<BODY bgcolor=lightblue>
<form>
Select the cities you have visited:
<SELECT name=“list” size=5>
<option> London</option>
<option> Tokyo</option>
<option> Paris</option>
<option> New York</option>
<option> LA</option>
<option> KL</option>
</SELECT>
</form>
</BODY>
110
111
</HEAD>
<BODY>
<h2><font color=blue>What type of Computer do you have?
</font><h2>
<FORM>
<SELECT NAME="ComputerType" size=4>
<OPTION value="IBM" SELECTED> IBM</OPTION>
<OPTION value="INTEL"> INTEL</OPTION>
<OPTION value=" Apple"> Apple</OPTION>
<OPTION value="Compaq"> Compaq</OPTION>
</SELECT>
</FORM></BODY></HTML>
112
113
Other Elements used in Forms
 List Box:
 Name: is the name of the variable to be
sent to the CGI application.
 SIZE: is greater than one.
114
<HEAD>
<TITLE>SELECT with Mutiple </TITLE> </HEAD>
<BODY>
<h2>
<font color=blue>What type of Computer do you have?</font><h2>
<FORM>
<SELECT NAME="ComputerType" size=5 multiple>
<OPTION value="IBM" > IBM</OPTION>
<OPTION value="INTEL"> INTEL</OPTION>
<OPTION value=" Apple"> Apple</OPTION>
<OPTION value="Compaq" SELECTED> Compaq</OPTION>
<OPTION value=" other"> Other</OPTION>
</SELECT>
</FORM>
</BODY>
</HTML>
115
116
REVISING – FORM ELEMENTS
MARQUEE TAG
• This tag is used text horizontally across
the screen.it is mainly used to deliver a
specfic message to the visitor or to scroll
Ads on a page.
• Example: <marquee> hello
world></marquee>
Attributes of marquee tag
• Bgcolor : Sets the background color of the marquee.
• Direction :Sets the direction of the marquee box to
either left-to-right, right-to-left, up-to-down
and down-to-up.
• Width: This sets how wide the marquee should be.
• Loop: This sets how many times the marquee should
'Loop' its text. Each trip counts as one loop.
SPECIAL CHARTACTER
• There are certain special characters that can be used
while creating document.Following are some special
character:
• Symbols Entity
©, ® &copy, &reg
¼, ½, ¾ &frac14, &frac12, &frac34
÷, <, >, ≤,≥ &divide, &lt, &gt, &le, &ge
& &amp
♣ ♠ ♥ &spades, &clubs, &hearts
All these special character must be ended with a
semicolon;
120
Special Characters & Symbols
Special Character Entity Name Special Character Entity Name
Ampersand &amp; & Greater-than sign &gt; >
Asterisk &lowast; ∗∗ Less-than sign &lt; <
Cent sign &cent; ¢ Non-breaking space &nbsp;
Copyright &copy; © Quotation mark &quot; "
Fraction one qtr &frac14; ¼ Registration mark &reg; ®
Fraction one half &frac12; ½ Trademark sign &trade; ™
Image Maps
121
 With HTML image maps, you can create clickable areas on an
image.
 The HTML <map> tag defines an image map. An image map is an
image with clickable areas. The areas are defined with one or more
<area> tags.
 The image is inserted using the <img> tag. The only difference from
other images is that you must add a usemap attribute:
<img src="workplace.jpg" alt="Workplace"
usemap="#workmap">
 The usemap value starts with a hash tag # followed by the name of
the image map, and is used to create a relationship between the image
and the image map.
Image Maps
122
Create Image Map
 Then, add a <map> element.
 The <map> element is used to create an image map, and is linked to
the image by using the required name attribute:
<map name="workmap">
 Then, add the clickable areas.
 A clickable area is defined using an <area> element.
 You must define the shape of the clickable area, and you can choose
one of these values:
 rect - defines a rectangular region
 circle - defines a circular region
 poly - defines a polygonal region
 default - defines the entire region
THANK YOU !!!
123

More Related Content

PDF
Simple intro to HTML and its applications
PPT
PPT
HTML5 with PHP.ini
PPTX
presentation_html_ppt_1.pptx
PDF
2a web technology html basics 1
PPTX
presentation_html_ppt_1534512076_351187.pptx
PPTX
HTML Presentation
Simple intro to HTML and its applications
HTML5 with PHP.ini
presentation_html_ppt_1.pptx
2a web technology html basics 1
presentation_html_ppt_1534512076_351187.pptx
HTML Presentation

Similar to Unit 1-HTML Final.ppt (20)

PPT
HTML NOTES.ppt BASIC HTML PROGRAMING NOTES
PPT
PPT
html tags
PPT
Web Design-III IT.ppt
PPT
Unit 2 (html)
PPTX
Introduction to HTML Communication Skills
PPTX
Presentation_ON _HTML Irfan Rashid .pptx
PPT
IntroHTMzczczscasasaklahduasihiaSUJScgGJKKL.ppt
PPT
Basics-of-HTML Basics-of-HTML Basics-of-HTML
PPT
902350 html jar
PPT
Web Design.ppt
PPT
HTML_Fundamentals_Tutorial_902350_HTML_Jar.ppt
PPT
902350_HTML_Jar.ppt
PPT
Intro to HTML
PPT
902350_HTML_Jar.ppt
PPT
html presentation on basis of tage .ppt
PPTX
DOC-20220920-WA0012..pptx
PPT
Introduction to HTML Basic to advance full
PPT
902350_HTML_Jar.ppt
PPT
web development html css javascrptt902350_HTML_Jar.ppt
HTML NOTES.ppt BASIC HTML PROGRAMING NOTES
html tags
Web Design-III IT.ppt
Unit 2 (html)
Introduction to HTML Communication Skills
Presentation_ON _HTML Irfan Rashid .pptx
IntroHTMzczczscasasaklahduasihiaSUJScgGJKKL.ppt
Basics-of-HTML Basics-of-HTML Basics-of-HTML
902350 html jar
Web Design.ppt
HTML_Fundamentals_Tutorial_902350_HTML_Jar.ppt
902350_HTML_Jar.ppt
Intro to HTML
902350_HTML_Jar.ppt
html presentation on basis of tage .ppt
DOC-20220920-WA0012..pptx
Introduction to HTML Basic to advance full
902350_HTML_Jar.ppt
web development html css javascrptt902350_HTML_Jar.ppt
Ad

More from TusharTikia (7)

PPTX
azureintroduction-19120610193256544.pptx
PPTX
B-Spline working and processing in. pptx
PPTX
Hospital management System for managing hospital.pptx
PPTX
bubblesort-130417100323-phpapp02[1].pptx
PPTX
Bubble Sort presentation.pptx
PPTX
WT Unit-3 PPT.pptx
PPT
Unit 2-CSS & Bootstrap.ppt
azureintroduction-19120610193256544.pptx
B-Spline working and processing in. pptx
Hospital management System for managing hospital.pptx
bubblesort-130417100323-phpapp02[1].pptx
Bubble Sort presentation.pptx
WT Unit-3 PPT.pptx
Unit 2-CSS & Bootstrap.ppt
Ad

Recently uploaded (20)

PPTX
Transform Your Business with a Software ERP System
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
top salesforce developer skills in 2025.pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Introduction to Artificial Intelligence
PPTX
Essential Infomation Tech presentation.pptx
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Understanding Forklifts - TECH EHS Solution
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Softaken Excel to vCard Converter Software.pdf
Transform Your Business with a Software ERP System
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
top salesforce developer skills in 2025.pdf
PTS Company Brochure 2025 (1).pdf.......
Introduction to Artificial Intelligence
Essential Infomation Tech presentation.pptx
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
How to Choose the Right IT Partner for Your Business in Malaysia
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
How to Migrate SBCGlobal Email to Yahoo Easily
Reimagine Home Health with the Power of Agentic AI​
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Design an Analysis of Algorithms II-SECS-1021-03
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Understanding Forklifts - TECH EHS Solution
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Softaken Excel to vCard Converter Software.pdf

Unit 1-HTML Final.ppt

  • 2. Static Pages / Dynamic Pages
  • 3. A static website is a group of self-contained, individual pages (or page), sent to the browser from the server one-page-at-a-time. SERVER page.html page.html page.html
  • 4. Dyamic web content is built when it is requested, by the user directly, or programmatically while a user is on a page (e.g., facebook updates). Most websites contain both static and dynamic elements. SERVER page.html SQL databases .net HTML
  • 5. Client-side (front-end) coding includes HTML, CSS and Javascript. This just means that our code will be downloaded from the server and then compiled entirely in the browser. SERVER page.html .asp SQL etc .net BROWSER style.css script.js
  • 6. Three layers of web design: Structure, Style, Behavior HTML, CSS, Javascript
  • 8. INTRODUCTION OF HTML • HTML is a language for describing web pages. • HTML stands for Hyper Text Markup Language • HTML is not a programming language, it is a markup language • A markup language is a set of markup tags • HTML uses markup tags to describe web pages
  • 9. OBJECTIVES OF HTML • create, save and view a HTML document • format a web page using section heading tags • describe Ordered and Unordered lists • explain graphics in HTML document • describe hypertext links and making text/image link
  • 10. ADVANTAGES OF HTML • Easy to use • Loose syntax (although, being too flexible will not comply with standards). • Supported on almost every browser, if not all browsers. • Widely used; established on almost every website, if not all websites. • Very similar to XML syntax, which is increasingly used for data storage. • Free - You need not buy any software. • Easy to learn & code even for novice programmers.
  • 11. DISADVANTAGES OF HTML • It cannot produce dynamic output alone, since it is a static language • Sometimes, the structuring of HTML documents is hard to grasp • You have to keep up with deprecated tags, and make sure not to use them • Deprecated tags appear because another language that works with HTML has replaced the original work of the tag; thus the other language needs to be learned (most of the time, it is CSS) • Security features offered by HTML are limited
  • 12. 12 Tags  Codes enclosed in brackets  Usually paired <TITLE>My Web Page</TITLE>  Not case sensitive <TITLE> = <title> = <Title>
  • 13. 13 Creating a Basic Starting Document <HTML> <HEAD> <TITLE>Tecnia Institute </TITLE> </HEAD> <BODY> This is what is displayed. </BODY> </HTML>
  • 14. 14 Color Codes • Colors are set using “RGB” color codes, which are, represented as hexadecimal values. Each 2-digit section of the code represents the amount, in sequence, of red, green or blue that forms the color. For example, a RGB value with 00 as the first two digits has no red in the color.
  • 18. 18 Color Codes 1. WHITE 2. BLACK 3. RED 4. GREEN 5. BLUE 6. MAGENTA 7. CYAN 8. YELLOW 9. AQUAMARINE 10. BAKER’S CHOCOLATE 11. VIOLET 12. BRASS 13. COPPER 14. PINK 15. ORANGE 1. #FFFFFF 2. #000000 3. #FF0000 4. #00FF00 5. #0000FF 6. #FF00FF 7. #00FFFF 8. #FFFF00 9. #70DB93 10. #5C3317 11. #9F5F9F 12. #B5A642 13. #B87333 14. #FF6EC7 15. #FF7F00
  • 19. 19 The Body Element • The BODY element of a web page is an important element in regards to the page’s appearance. Here are the attributes of the BODY tag to control all the levels: TEXT="#RRGGBB" to change the color of all the text on the page (full page text color.)  This element contains information about the page’s background color, the background image, as well as the text and link colors.
  • 20. 20 Background Color  It is very common to see web pages with their background color set to white or some other colors.  To set your document’s background color, you need to edit the <BODY> element by adding the BGCOLOR attribute. The following example will display a document with a white background color: <BODY BGCOLOR=“#FFFFFF”></BODY>
  • 21. 21 TEXT Color  The TEXT attribute is used to control the color of all the normal text in the document. The default color for text is black. The TEXT attribute would be added as follows: <BODY BGCOLOR=“#FFFFFF” TEXT=“#FF0000”></BODY> In this example the document’s page color is white and the text would be red.
  • 22. 22 LINK, VLINK, and ALINK These attributes control the colors of the different link states: 1. LINK – initial appearance – default = Blue. 2. VLINK – visited link – default = Purple. 3. ALINK –active link being clicked–default= Yellow. The Format for setting these attributes is: <BODY BGCOLOR=“#FFFFFF” TEXT=“#FF0000” LINK=“#0000FF” VLINK=“#FF00FF” ALINK=“FFFF00”> </BODY>
  • 23. 23 Using Image Background  The BODY element also gives you ability of setting an image as the document’s background.  An example of a background image’s HTML code is as follows: <BODY BACKGROUND=“hi.gif” BGCOLOR=“#FFFFFF”></BODY>
  • 24. 24 Headings, <Hx> </Hx> <HTML> <HEAD> <TITLE> Example Page</TITLE> </HEAD> <BODY> <H1> Heading 1 </H1> <H2> Heading 2 </H2> <H3> Heading 3 </H3> <H4> Heading 4 </H4> <H5> Heading 5 </H5> <H6> Heading 6 </H6> </BODY> </HTML> Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6
  • 25. 25 Paragraphs, <P> </P> <HTML><HEAD> <TITLE> Example Page</TITLE> </HEAD> <BODY></H1> Heading 1 </H1> <P> Paragraph 1, ….</P> <H2> Heading 2 </H2> <P> Paragraph 2, ….</P> <H3> Heading 3 </H3> <P> Paragraph 3, ….</P> <H4> Heading 4 </H4> <P> Paragraph 4, ….</P> <H5> Heading 5 </H5> <P> Paragraph 5, ….</P> <H6> Heading 6</H6> <P> Paragraph 6, ….</P> </BODY></HTML> Heading 1 Paragraph 1,…. Heading 2 Paragraph 2,…. Heading 3 Paragraph 3,…. Heading 4 Paragraph 4,…. Heading 5 Paragraph 5,…. Heading 6 Paragraph 6,….
  • 26. 26 Break, <BR>  Line breaks allow you to decide where the text will break on a line or continue to the end of the window.  A <BR> is an empty Element, meaning that it may contain attributes but it does not contain content.  The <BR> element does not have a closing tag.
  • 27. 27 Break, <BR> <HTML> <HEAD> <TITLE> Example Page</TITLE> </HEAD> <BODY> <H1> Heading 1 </H1> <P>Paragraph 1, <BR> Line 2 <BR> Line 3 <BR>…. </P> </BODY> </HTML> Heading 1 Paragraph 1,…. Line 2 Line 3 ….
  • 28. 28 Horizontal Rule, <HR>  The <HR> element causes the browser to display a horizontal line (rule) in your document.  <HR> does not use a closing tag, </HR>.
  • 29. 29 Horizontal Rule, <HR> Attribute Description Default Value SIZE Height of the rule in pixels 2 pixels WIDTH Width of the rule in pixels or percentage of screen width 100% NOSHADE Draw the rule with a flat look instead of a 3D look Not set (3D look) ALIGN Aligns the line (Left, Center, Right) Center COLOR Sets a color for the rule (IE 3.0 or later) Not set
  • 30. 30 Horizontal Rule, <HR> <HTML> <HEAD> <TITLE> Example Page</TITLE> </HEAD> <BODY> <H1> Heading 1 </H1> <P>Paragraph 1, <BR> Line 2 <BR> <HR>Line 3 <BR> </P> </BODY> </HTML> Heading 1 Paragraph 1,…. Line 2 ______________________ _____ Line 3
  • 31. 31 Character Formatting How to enhance your page with Bold, Italics, and other character formatting options. 1. Change the color and size of your text. 2. Use Common Character Formatting Elements. 3. Align your text. 4. Add special characters. 5. Use other character formatting elements.
  • 32. 32 Bold, Italic and other Character Formatting Elements  <FONT SIZE=“+2”> Two sizes bigger</FONT>  The size attribute can be set as an absolute value from 1 to 7 or as a relative value using the “+” or “-” sign. Normal text size is 3 (from -2 to +4).  <B> Bold </B>  <I> Italic </I>  <U> Underline </U>  Color = “#RRGGBB” The COLOR attribute of the FONT element. E.g., <FONT COLOR=“#RRGGBB”>this text has color</FONT>  <PRE> Preformatted </PRE> Text enclosed by PRE tags is displayed in a mono-spaced font. Spaces and line breaks are supported without additional elements or special characters.
  • 33. 33 Bold, Italic and other Character Formatting Elements <P> <FONT SIZE=“+1”> One Size Larger </FONT> - Normal – <FONT SIZE=“-1”> One Size Smaller </FONT> <BR> <B> Bold</B> - <I> italics</I> - <U> Underlined </U> - <FONT COLOR=“#FF0000”> Colored </FONT> <BR> <EM> Emphasized</EM> - <STRONG> Strong </STRONG> - <TT> Tele Type </TT> <BR> One Size Larger - Normal – One Size Smaller Bold - italics - Underlined - Colored Emphasized - Strong - Tele Type
  • 34. 34 Alignment  Some elements have attributes for alignment (ALIGN) e.g. Headings, Paragraphs and Horizontal Rules.  The Three alignment values are : LEFT, RIGHT, CENTER.  <CENTER></CENTER> Will center elements.
  • 35. 35 Alignment  <DIV ALIGN=“value”></DIV> Represents a division in the document and can contain most other element type. The alignment attribute of the DIV element is well supported.  <TABLE></TABLE> Inside a TABLE, alignment can be set for each individual cell.
  • 36. 36 Additional Character Formatting Elements  <STRIKE> strike-through text</STRIKE> DEL is used for STRIKE at the latest browsers  <BIG> places text in a big font</BIG>  <SMALL> places text in a small font</SMALL>  <SUB> places text in subscript position </SUB>  <SUP> places text in superscript style position </SUP>
  • 37. 37 Lists In this chapter you will learn how to create a variety of lists. Objectives Upon completing this section, you should be able to 1. Create an unordered list. 2. Create an ordered list. 3. Create a defined list. 4. Nest Lists.
  • 38. 38 List Elements  HTML supplies several list elements. Most list elements are composed of one or more <LI> (List Item) elements.  UL : Unordered List. Items in this list start with a list mark such as a bullet. Browsers will usually change the list mark in nested lists. <UL> <LI> List item …</LI> <LI> List item …</LI> </UL> • List item … • List item …
  • 39. 39 List Elements  You have the choice of three bullet types: disc(default), circle, square.  These are controlled in Netscape Navigator by the “TYPE” attribute for the <UL> element. <UL TYPE=“square”> <LI> List item …</LI> <LI> List item …</LI> <LI> List item …</LI> </UL>  List item …  List item …  List item …
  • 40. 40 List Elements  OL: Ordered List. Items in this list are numbered automatically by the browser. <OL type=“A”> <LI> List item …</LI> <LI> List item …</LI> <LI> List item …</LI> </OL> A. List item … B. List item … C. List item  You have the choice of setting the TYPE Attribute to one of five numbering styles.
  • 41. 41 List Elements TYPE Numbering Styles 1 Arabic numbers 1,2,3, …… a Lower alpha a, b, c, …… A Upper alpha A, B, C, …… i Lower roman i, ii, iii, …… I Upper roman I, II, III, ……
  • 42. 42 Images  <IMG>This element defines a graphic image on the page.  Image File (SRC:source): This value will be a URL (location of the image) E.g. http://www.domain.com/dir/file.ext or /dir/file.txt.  Alternate Text (ALT): This is a text field that describes an image or acts as a label. It is displayed when they position the cursor over a graphic image.  Alignment (ALIGN): This allows you to align the image on your page.
  • 43. 43 Images  Width (WIDTH): is the width of the image in pixels.  Height (HEIGHT): is the height of the image in pixels.  Border (BORDER): is for a border around the image, specified in pixels.  HSPACE: is for Horizontal Space on both sides of the image specified in pixels. A setting of 5 will put 5 pixels of invisible space on both sides of the image.  VSPACE: is for Vertical Space on top and bottom of the image specified in pixels. A setting of 5 will put 5 pixels of invisible space above and bellow the image.
  • 44. 44 Some Examples on images 1) <IMG SRC=“jordan.gif“ border=4> 2) <IMG SRC=" jordan.gif" width="60" height="60"> 3) <IMG SRC=“jordan.gif" ALT="This is a text that goes with the image"> 4) <IMG SRC=" jordan.gif “ Hspace="30" Vspace="10" border=20 5) < IMG SRC =" jordan.gif“ align="left"> blast blast blast blast blast
  • 45. 45 HOW TO MAKE A LINK 1) The tags used to produce links are the <A> and </A>. The <A> tells where the link should start and the </A> indicates where the link ends. Everything between these two will work as a link. 2) The example below shows how to make the word Here work as a link to yahoo. Click <A HREF="http://www.yahoo.com">here</A> to go to yahoo.
  • 46. 46 Internal Links  Internal Links : Links can also be created inside large documents to simplify navigation. Today’s world wants to be able to get the information quickly. Internal links can help you meet these goals. 1. Select some text at a place in the document that you would like to create a link to, then add an anchor to link to like this: <A NAME=“bookmark_name”></A> The Name attribute of an anchor element specifies a location in the document that we link to shortly. All NAME attributes in a document must be unique. 2. Next select the text that you would like to create as a link to the location created above. <A HREF=“#bookmark_name”>Go To Book Mark</A>
  • 47. 47 Tables  The <TABLE></TABLE> element has four sub-elements: 1. Table Row<TR></TR>. 2. Table Header <TH></TH>. 3. Table Data <TD></TD>. 4. Caption <CAPTION></CAPTION>.  The table row elements usually contain table header elements or table data elements.
  • 48. 48 Tables <table border=“1”> <tr> <th> Column 1 header </th> <th> Column 2 header </th> </tr> <tr> <td> Row1, Col1 </td> <td> Row1, Col2 </td> </tr> <tr> <td> Row2, Col1 </td> <td> Row2, Col2 </td> </tr> </table>
  • 49. 49 Tables Column 1 Header Column 2 Header Row1, Col1 Row1, Col2 Row2, Col1 Row2, Col2
  • 50. 50 Tables Attributes  BGColor: Some browsers support background colors in a table.  Width: you can specify the table width as an absolute number of pixels or a percentage of the document width. You can set the width for the table cells as well.  Border: You can choose a numerical value for the border width, which specifies the border in pixels.  CellSpacing: Cell Spacing represents the space between cells and is specified in pixels.  CellPadding: Cell Padding is the space between the cell border and the cell contents and is specified in pixels.  Align: tables can have left, right, or center alignment.
  • 51. 51 Table Caption  A table caption allows you to specify a line of text that will appear centered above or bellow the table. <TABLE BORDER=1 CELLPADDING=2> <CAPTION ALIGN=“BOTTOM”> Label For My Table </CAPTION>  The Caption element has one attribute ALIGN that can be either TOP (Above the table) or BOTTOM (below the table).
  • 52. 52 Table Data and Table Header Attributes  Colspan: Specifies how many cell columns of the table this cell should span.  Rowspan: Specifies how many cell rows of the table this cell should span.  Align: cell data can have left, right, or center alignment.  Valign: cell data can have top, middle, or bottom alignment.  Width: you can specify the width as an absolute number of pixels or a percentage of the document width.  Height: You can specify the height as an absolute number of pixels or a percentage of the document height.
  • 53. 53 <TABLE BORDER width=“750”> <TR> <TD colspan=“4” align=“center”>Page Banner</TD></TR> <TR> <TD rowspan=“2” width=“25%”>Nav Links</TD><TD colspan=“2”>Feature Article</TD> <TD rowspan=“2” width=“25%”>Linked Ads</TD></TR> <TR><TD width=“25%”>News Column 1 </TD> <TD width=“25%”><News Column 2 </TD></TR> </TABLE> What will be the output?
  • 55. 55 Frames  Frames are a relatively new addition to the HTML standard. First introduced in Netscape Navigator 2.0. Objectives: Upon completing this section, you should be able to:  Create a Frame based page.  Work with the Frameset, Frame, and Noframes elements.  Use the attributes of the Frames elements to control the display.  Set Targets appropriately.
  • 56. 56 Frames  A framed page is actually made up of multiple HTML pages. There is one HTML document that describes how to break up the single browser window into multiple windowpanes. Each windowpane is filled with an HTML document.  For Example to make a framed page with a windowpane on the left and one on the right requires three HTML pages. Doc1.html and Doc2.html are the pages that contain content. Frames.html is the page that describes the division of the single browser window into two windowpanes.
  • 58. 58 Frame Page Architecture  A <FRAMESET> element is placed in the html document before the <BODY> element. The <FRAMESET> describes the amount of screen real estate given to each windowpane by dividing the screen into ROWS or COLS.  The <FRAMESET> will then contain <FRAME> elements, one per division of the browser window.  Note: Because there is no BODY container, FRAMESET pages can't have background images and background colors associated with them.
  • 59. 59 Frame Page Architecture <HTML> <HEAD> <TITLE> Framed Page </TITLE> <FRAMeSET COLS=“23%,77%”> <FRAME SRC=“Doc1.html”> <FRAME SRC=“Doc2.html”> </FRAMeSET > </HEAD> </HTML>
  • 60. 60 The Diagram below is a graphical view of the document described above FRAMESET COLS=”23%, 77%” FRAME NAME=right_pane SRC= Doc2.html FRAME NAME= left_pane SRC=Doc1.h tml
  • 61. 61 <FRAMESET> Container <FRAMESET> : The FRAMESET element creates divisions in the browser window in a single direction. This allows you to define divisions as either rows or columns.  ROWS : Determines the size and number of rectangular rows within a <FRAMESET>. They are set from top of the display area to the bottom. Possible values are:  Absolute pixel units, I.e. “360,120”.  A percentage of screen height, e.g. “75%,25%”.  Proportional values using the asterisk (*). This is often combined with a value in pixels , e.g. “360,*”.  <Frameset cols=“200,20%,*,2*”>
  • 62. 62 Creating a Frames Page  COLS: Determines the size and number of rectangular columns within a <FRAMESET>. They are set from left to right of the display area. Possible values are:  Absolute pixel units, I.e. “480,160”.  A percentage of screen width, e.g. “75%,25%”.  Proportional values using the asterisk (*). This is often combined with a value in pixels , e.g. “480,*”.
  • 63. 63 Attributes of <Frameset> tag  FRAMEBORDER : Possible values 0, 1, YES, NO. A setting of zero will create a borderless frame.  FRAMESPACING: This attribute is specified in pixels. If you go to borderless frames you will need to set this value to zero as well, or you will have a gap between your frames where the border used to be.  BORDER(thickness of the Frame): This attribute specified in pixels. A setting of zero will create a borderless frame. Default value is 5.  BORDERCOLOR: This attribute is allows you choose a color for your border. This attribute is rarely used.  ROWS  COLS
  • 64. 64 <FRAME> <FRAME>: This element defines a single frame within a frameset. There will be a FRAME element for each division created by the FRAMESET element. This tag has the following attributes:  SRC: Required, as it provides the URL for the page that will be displayed in the frame.  NAME: Required for frames that will allow targeting by other HTML documents. Works in conjunction with the target attribute of the <A>, <AREA>, <BASE>, and <FORM> tags.
  • 65. 65 Attributes of <FRAME> tag  MARGINWIDTH: Optional attribute stated in pixels. Determines horizontal space between the <FRAME> contents and the frame’s borders.  MARGINHEIGHT: Optional attribute stated in pixels. Determines vertical space between the <FRAME> contents and the frame’s borders.  SCROLLING: Displays a scroll bar(s) in the frame. Possible values are: 1. Yes – always display scroll bar(s). 2. No – never display scroll bar(s). 3. Auto – browser will decide based on frame contents. By default: scrolling is auto.
  • 66. 66 Frame Formatting • Example: <frameset rows=“20%, *, 20%” border=4> <frame src=“header.html” noresize scrolling=no> <frame src=“body.html”> <frame src=“navigationbar.html” noresize scrolling=no> </frameset>
  • 67. 67 Targets  When you use links for use in a frames environment you will need to specify an additional attribute called TARGET.  The TARGET attribute uses the NAME attribute of the FRAME element.  If we were to place a link in doc1.html that linked to doc3.html and we wanted doc3.html to be displayed in the right windowpane; the HTML code would appear in doc1.html as follows: <A HREF=“doc3.html” TARGET=“right_pane”>Link to Document 3 </A>
  • 68. 68 Special Targets • There are 4 special target names that cannot be assigned by the NAME attribute of the FRAME tag. 1. TARGET=“_top” : This loads the linked document into the full browser window with the URL specified by the HREF attribute. All frames disappear, leaving the new linked page to occupy the entire window. The back is turned on. 2. TARGET=“_blank” : Opens an unnamed new browser window and loads the document specified in the URL attribute into the new window (and your old window stays open). The back is turned off. Other windows remains on. 3. TARGET=“_self” : Loads the document in the same window where the anchor was {Clicked}. This is the default setting for linking elements. 4. TARGET=“_parent” : the _parent frame is a prior frameset that the current frameset was “spawned” from. If there isn’t one it is the browser window. The document is loaded into the area occupied by the columns or rows frameset containing the frame that contains the link. The back is turned on. All windows disappear.
  • 69. 69 If a frame contains the following link, then clicking the link launches a new, unnamed browser display window that contains the content defined in stuff.HTM. This can be a simple HTML document, or an entirely new FRAMESET definition. 1. <A HREF="stuff.html" TARGET="_blank"> If a frame contains the following link, then clicking the link will simply cause the frame which contains the link to clear, and its content will be replaced with whatever is in stuff.htm. 2. <A HREF="stuff.html" TARGET="_self"> If a frame contains the following link, the frameset that contains the frame that contains this link will be replaced by stuff.HTM. 3. <A HREF="stuff.html" TARGET="_parent"> Finally, if a frame contains the following link, clicking the link replaces the entire browser window with the contents of stuff.HTM. 4. <A HREF="stuff.html" TARGET="_top">
  • 70. 70 Targeting links to frames The TARGET attribute allows you to specify the frame into which a page is to be loaded into in a frames setting. <A HREF=“chap1.html” TARGET=“_self”> [Chapter 1]</A> <A HREF=“chap1.html” TARGET=“_parent”> [Chapter 2]</A> Parent window Learning HTML [Chapter 1][Chapter 2][Chapter 3] chap1.html chap2.html
  • 71. 71 Targeting links to frames The TARGET attribute allows you to specify the frame into which a page is to be loaded into in a frames setting. <A HREF=“chap1.html” TARGET=“bottom”> [Chapter 1]</A> <A HREF=“chap2.html” TARGET=“bottom”> [Chapter 2]</A> <A HREF=“chap3.html” TARGET=“bottom”> [Chapter 3]</A> Learning HTML [Chapter 1][Chapter 2][Chapter 3] chap1.html chap2.html chap3.html
  • 72. 72 Forms  Forms add the ability to web pages to not only provide the person viewing the document with dynamic information but also to obtain information from the person viewing it, and process the information. 1. Create a FORM. 2. Add elements to a FORM. 3. Define CGI (Common Gateway Interface). 4. Describe the purpose of a CGI Application. 5. Specify an action for the FORM.  Forms work in all browsers.  Forms are Platform Independent.
  • 73. 73 Forms  To insert a form we use the <FORM></FORM> tags. The rest of the form elements must be inserted in between the form tags. <HTML> <HEAD> <TITLE> Sample Form</TITLE> </HEAD> <BODY BGCOLOR=“FFFFFF”> <FORM ACTION = http://www.xnu.com/formtest.asp> <P> First Name: <INPUT TYPE=“TEXT” NAME=“fname” MAXLENGTH=“50”> </P> <P> <INPUT TYPE=“SUBMIT” NAME=“fsubmit1” VALUE=“Send Info”> </P> </FORM> </BODY> </HTML>
  • 74. 74 <FORM> element attributes  ACTION: is the URL of the CGI (Common Gateway Interface) program that is going to accept the data from the form, process it, and send a response back to the browser.  METHOD: GET (default) or POST specifies which HTTP method will be used to send the form’s contents to the web server. The CGI application should be written to accept the data from either method.  NAME: is a form name used by VBScript or JavaScripts.  TARGET: is the target frame where the response page will show up.
  • 75. 75 Form Elements  Form elements have properties: Text boxes, Password boxes, Checkboxes, Option(Radio) buttons, Submit, Reset, File, Hidden and Image.  The properties are specified in the TYPE Attribute of the HTML element <INPUT></INPUT>.
  • 77. 77 Form Elements <INPUT> Element’s Properties TYPE= Type of INPUT entry field. NAME = Variable name passed to CGI application VALUE= The data associated with the variable name to be passed to the CGI application CHECKED= Button/box checked SIZE= Number of visible characters in text field MAXLENGHT= Maximum number of characters accepted.
  • 78. 78 Text Box  Text boxes: Used to provide input fields for text, phone numbers, dates, etc. <INPUT TYPE= " TEXT " > Browser will display Textboxes use the following attributes:  TYPE: text.  SIZE: determines the size of the textbox in characters. Default=20 characters.  MAXLENGHT : determines the maximum number of characters that the field will accept.  NAME: is the name of the variable to be sent to the CGI application.  VALUE: will display its contents as the default value.
  • 79. 79 <TITLE>Form_Text_Type</TITLE> </HEAD> <BODY> <h1> <font color=blue>Please enter the following bioData</font></h1> <FORM name="fome1" Method= " get " Action= " URL " > First Name: <INPUT TYPE="TEXT" NAME="FName" SIZE="15" MAXLENGTH="25"><BR> Last Name: <INPUT TYPE="TEXT" NAME="LName" SIZE="15" MAXLENGTH="25"><BR> Nationality: <INPUT TYPE="TEXT" NAME="Country" SIZE="25" MAXLENGTH="25"><BR> The Phone Number: <INPUT TYPE="TEXT" NAME="Phone" SIZE="15" MAXLENGTH="12"><BR> </FORM> </BODY> </HTML> Example on Text Box
  • 81. 81  Password: Used to allow entry of passwords. <INPUT TYPE= " PASSWORD " > Browser will display Text typed in a password box is starred out in the browser display. Password boxes use the following attributes:  TYPE: password.  SIZE: determines the size of the textbox in characters.  MAXLENGHT: determines the maximum size of the password in characters.  NAME: is the name of the variable to be sent to the CGI application.  VALUE: is usually blank. Password
  • 82. 82 <HTML> <HEAD> <TITLE>Form_Password_Type</TITLE></HEAD> <BODY> <h1> <font color=red>To Access, Please enter:</font></h1> <FORM name="fome2" Action="url" method="get"> User Name: <INPUT TYPE="TEXT" Name="Fname” SIZE="15" MAXLENGTH="25"><BR> Password: <INPUT TYPE="PASSWORD“ NAME="PWord" value="" SIZE="15” MAXLENGTH="25"><BR> </FORM> </BODY> </HTML> Example on Password Box
  • 84. 84  Hidden: Used to send data to the CGI application that you don’t want the web surfer to see, change or have to enter but is necessary for the application to process the form correctly. <INPUT TYPE=“HIDDEN”> Nothing is displayed in the browser. Hidden inputs have the following attributes:  TYPE: hidden.  NAME: is the name of the variable to be sent to the CGI application.  VALUE: is usually set a value expected by the CGI application. Hidden
  • 85. 85 Check Box  Check Box: Check boxes allow the users to select more than one option. <INPUT TYPE=“CHECKBOX”> Browser will display Checkboxes have the following attributes:  TYPE: checkbox.  CHECKED: is blank or CHECKED as the initial status.  NAME: is the name of the variable to be sent to the CGI application.  VALUE: is usually set to a value.
  • 86. 86 <HTML> <HEAD><TITLE>CheckBoxType</TITLE> </HEAD> <BODY> <h1> <font color=green>Please check one of the following</font> </h1> <FORM name="forme" Action="url" method="get"> <font color=red> Select Country: </font><BR> jordan:<INPUT TYPE="CheckBox" Name="country" CHECKED><BR> Yemen<INPUT TYPE="CheckBox" Name="country"><BR> Qatar:<INPUT TYPE="CheckBox" Name="country"><BR> <BR> <font color=blue>Select Language:</font><BR> Arabic:<INPUT TYPE="CheckBox" Name="language" CHECKED><BR> English:<INPUT TYPE="CheckBox" Name="language"><BR> French:<INPUT TYPE="CheckBox" Name="language"> <BR> </FORM> </BODY> </HTML>
  • 88. 88  Radio Button: Radio buttons allow the users to select only one option. <INPUT TYPE=“RADIO”> Browser will display Radio buttons have the following attributes:  TYPE: radio.  CHECKED: is blank or CHECKED as the initial status. Only one radio button can be checked  NAME: is the name of the variable to be sent to the CGI application.  VALUE: usually has a set value. Radio Button
  • 89. 89 <HTML> <HEAD><TITLE>CheckBoxType</TITLE> </HEAD> <BODY> <h1> <font color=green>Please check one of the following</font></h1> <FORM name="fome3" Action="url" method="get"> <font color=red> Select Country: </font><BR> jordan:<INPUT TYPE= "RADIO" Name="country" CHECKED><BR> Yemen<INPUT TYPE="RADIO " Name="country"><BR> Qatar:<INPUT TYPE="RADIO" Name="country"><BR> <BR> <font color=blue>Select Language:</font><BR> Arabic:<INPUT TYPE="RADIO" Name="language" CHECKED><BR> English:<INPUT TYPE=" RADIO " Name="language"><BR> French:<INPUT TYPE=" RADIO " Name="language"> <BR> </FORM> </BODY> </HTML>
  • 90. 90
  • 91. 91 <HTML><HEAD> <TITLE>RADIOBox</TITLE> </HEAD> <BODY> Form #1: <FORM> <INPUT TYPE="radio" NAME="choice" VALUE="one"> Yes. <INPUT TYPE="radio" NAME="choice" VALUE="two"> No. </FORM> <HR color=red size="10" > Form #2: <FORM> <INPUT TYPE="radio" NAME="choice" VALUE="three" CHECKED> Yes. <INPUT TYPE="radio" NAME="choice" VALUE="four"> No. </FORM> </BODY
  • 93. 93  Push Button: This element would be used with JavaScript to cause an action to take place. <INPUT TYPE=“BUTTON”> Browser will display Push Button has the following attributes:  TYPE: button.  NAME: is the name of the button to be used in scripting.  VALUE: determines the text label on the button. Push Button
  • 94. 94 <DIV align=center><BR><BR> <FORM> <FONT Color=red> Press Here to see a baby crying:<BR> <INPUT TYPE="button" VALUE="PressMe"><BR><BR> <FONT Color=blue> Click Here to see a baby shouting:<BR> <INPUT TYPE="button" VALUE="ClickMe" > <BR><BR> <FONT Color=green> Hit Here to see a baby eating:<BR> <INPUT TYPE="button" VALUE="HitME" > <BR><BR> </FORM> </DIV>
  • 95. 95
  • 96. 96  Submit: Every set of Form tags requires a Submit button. This is the element causes the browser to send the names and values of the other elements to the CGI Application specified by the ACTION attribute of the FORM element. <INPUT TYPE=“SUBMIT”> The browser will display Submit has the following attributes:  TYPE: submit.  NAME: value used by the CGI script for processing.  VALUE: determines the text label on the button, usually Submit Query. Submit Button
  • 97. 97 <FORM Action="URL" method="get"> First Name: <INPUT TYPE="TEXT" Size=25 name="firstName"><BR> Family Name: <INPUT TYPE="TEXT" Size=25 name="LastName"><BR> <BR> <FONT Color=red> Press Here to submit the data:<BR> <INPUT TYPE="submit" VALUE="SubmitData " > </FORM>
  • 98. 98
  • 99. 99 Reset Button • Reset: It is a good idea to include one of these for each form where users are entering data. It allows the surfer to clear all the input in the form. • <INPUT TYPE=“RESET”> • Browser will display • • Reset buttons have the following attributes: • TYPE: reset. • VALUE: determines the text label on the button, usually Reset.
  • 100. 100 <FORM Action="URL" method="get"> First Name: <INPUT TYPE="TEXT" Size=25 name="firstName"> <BR> Family Name: <INPUT TYPE="TEXT" Size=25 name="LastName"> <BR> <BR> <FONT Color = red> <STRONG><font size=5>Press Here to submit the data: </font> </STRONG><BR> <INPUT TYPE="submit" VALUE="SubmitData"> <INPUT TYPE="RESET" VALUE="Reset"> </FORM>
  • 101. 101
  • 102. 102 • File Upload: You can use a file upload to allow surfers to upload files to your web server. • <INPUT TYPE=“FILE”> • Browser will display • File Upload has the following attributes: • TYPE: file. • SIZE: is the size of the text box in characters. • NAME: is the name of the variable to be sent to the CGI application. • MAXLENGHT: is the maximum size of the input in the textbox in characters. File
  • 103. 103 <BODY bgcolor=lightblue> <form> <H3><font color=forestgreen> Please attach your file here for uploading <font color =red>SERVER...<BR> <INPUT TYPE="File" name="myFile" size="30"> <INPUT TYPE="Submit" value="SubmitFile"> </form> </BODY>
  • 104. 104 Other Elements used in Forms  <TEXTAREA></TEXTAREA>: is an element that allows for free form text entry. Browser will display Textarea has the following attributes:  NAME: is the name of the variable to be sent to the CGI application.  ROWS: the number of rows to the textbox.  COLS: the number of columns to the textbox.
  • 105. 105 <BODY bgcolor=lightblue> <form> <TEXTAREA COLS=40 ROWS=20 Name="comments" > From observing the apathy of those about me during flag raising I concluded that patriotism if not actually on the decline is at least in a state of dormancy. </TEXTAREA>: </form> </BODY>
  • 106. 106
  • 107. 107 Other Elements used in Forms  The two following examples are <SELECT></SELECT> elements, where the attributes are set differently. The Select elements attributes are:  NAME: is the name of the variable to be sent to the CGI application.  SIZE: this sets the number of visible choices.  MULTIPLE: the presence of this attribute signifies that the user can make multiple selections. By default only one selection is allowed.
  • 108. 108 Other Elements used in Forms  Option The list items are added to the <SELECT> element by inserting <OPTION></OPTION> elements. The Option Element’s attributes are:  SELECTED: When this attribute is present, the option is selected when the document is initially loaded. It is an error for more than one option to be selected.  VALUE: Specifies the value the variable named in the select element.
  • 109. 109 <BODY bgcolor=lightblue> <form> Select the cities you have visited: <SELECT name=“list” size=5> <option> London</option> <option> Tokyo</option> <option> Paris</option> <option> New York</option> <option> LA</option> <option> KL</option> </SELECT> </form> </BODY>
  • 110. 110
  • 111. 111 </HEAD> <BODY> <h2><font color=blue>What type of Computer do you have? </font><h2> <FORM> <SELECT NAME="ComputerType" size=4> <OPTION value="IBM" SELECTED> IBM</OPTION> <OPTION value="INTEL"> INTEL</OPTION> <OPTION value=" Apple"> Apple</OPTION> <OPTION value="Compaq"> Compaq</OPTION> </SELECT> </FORM></BODY></HTML>
  • 112. 112
  • 113. 113 Other Elements used in Forms  List Box:  Name: is the name of the variable to be sent to the CGI application.  SIZE: is greater than one.
  • 114. 114 <HEAD> <TITLE>SELECT with Mutiple </TITLE> </HEAD> <BODY> <h2> <font color=blue>What type of Computer do you have?</font><h2> <FORM> <SELECT NAME="ComputerType" size=5 multiple> <OPTION value="IBM" > IBM</OPTION> <OPTION value="INTEL"> INTEL</OPTION> <OPTION value=" Apple"> Apple</OPTION> <OPTION value="Compaq" SELECTED> Compaq</OPTION> <OPTION value=" other"> Other</OPTION> </SELECT> </FORM> </BODY> </HTML>
  • 115. 115
  • 117. MARQUEE TAG • This tag is used text horizontally across the screen.it is mainly used to deliver a specfic message to the visitor or to scroll Ads on a page. • Example: <marquee> hello world></marquee>
  • 118. Attributes of marquee tag • Bgcolor : Sets the background color of the marquee. • Direction :Sets the direction of the marquee box to either left-to-right, right-to-left, up-to-down and down-to-up. • Width: This sets how wide the marquee should be. • Loop: This sets how many times the marquee should 'Loop' its text. Each trip counts as one loop.
  • 119. SPECIAL CHARTACTER • There are certain special characters that can be used while creating document.Following are some special character: • Symbols Entity ©, ® &copy, &reg ¼, ½, ¾ &frac14, &frac12, &frac34 ÷, <, >, ≤,≥ &divide, &lt, &gt, &le, &ge & &amp ♣ ♠ ♥ &spades, &clubs, &hearts All these special character must be ended with a semicolon;
  • 120. 120 Special Characters & Symbols Special Character Entity Name Special Character Entity Name Ampersand &amp; & Greater-than sign &gt; > Asterisk &lowast; ∗∗ Less-than sign &lt; < Cent sign &cent; ¢ Non-breaking space &nbsp; Copyright &copy; © Quotation mark &quot; " Fraction one qtr &frac14; ¼ Registration mark &reg; ® Fraction one half &frac12; ½ Trademark sign &trade; ™
  • 121. Image Maps 121  With HTML image maps, you can create clickable areas on an image.  The HTML <map> tag defines an image map. An image map is an image with clickable areas. The areas are defined with one or more <area> tags.  The image is inserted using the <img> tag. The only difference from other images is that you must add a usemap attribute: <img src="workplace.jpg" alt="Workplace" usemap="#workmap">  The usemap value starts with a hash tag # followed by the name of the image map, and is used to create a relationship between the image and the image map.
  • 122. Image Maps 122 Create Image Map  Then, add a <map> element.  The <map> element is used to create an image map, and is linked to the image by using the required name attribute: <map name="workmap">  Then, add the clickable areas.  A clickable area is defined using an <area> element.  You must define the shape of the clickable area, and you can choose one of these values:  rect - defines a rectangular region  circle - defines a circular region  poly - defines a polygonal region  default - defines the entire region

Editor's Notes