Section 1 HTML (Hypertext Markup Language)
Section 1 HTML (Hypertext Markup Language)
LANGUAGE)
Structure
1.0 Basics of HTML
1.1 How to Create HTML Document?
1.2 Steps for Creating a Simple HTML Program
1.3 Exercises for Practice in Lab Sessions
No matter where they originated, most Web documents are created using Hypertext
Markup Language (HTML). HTML is a powerful authoring language and has
different versions like HTML 4.2, HTML 4.0, HTML 3.2, HTML 3.0 and HTML 2.
HTML is used to define document structure and format, with the help of a single tag
or a pair of tags. A tag is a string in the language surrounded by a less than (<) and a
greater than (>) sign. An opening tag does not begin with a slash (/). An ending or
closing tag is a string that begins with a slash (/).
HTML documents format textual information with embedded markup tags that
provide style and structure information. A whole document in HTML begins with
<HTML> and ends with </HTML>.
5
Lab Manual 2. Begin with a document type tag and an <HTML> opening tag. Enter the
following line in your doc.
<HTML>
3. Indicate that you are beginning the head element of a document by issuing the
<HEAD> opening tag. If a <HEAD> element is included, it must appear within
an <HTML> element. The following line should appear next in your document:
<HEAD>
6. At this point the body of the document is developed. A <BODY> opening tag
indicates that this point has been reached. Enter the following line.
<BODY>
7. In the following example, the body of the document contains a simple text
statement which you can now enter in your file:
Hello World !
8. A </BODY> closing tag marks the end of the <BODY> element. Similar to the
Head element, the <BODY> element is also completely nested within the
<HTML> element. To end the <BODY> element, issue the closing
corresponding tag in your document.
</BODY>
6
HTML (Hypertext
Markup Language)
11. To view the document open the .html document in the browser.
2. Create an HTML document giving details of your name, age, telephone number,
address, TLC code & enrolment number aligned in proper order.
SESSION 2
Exercises
1. Create a page to show different attributes of Font tag.
3. Design a page having background colour yellow, giving text colour red and
using all the attributes of font tab.
SESSION 3
Exercises
1. Write an HTML code to create a Web page of blue color and display links in
red colour.
2. Write an HTML code to create a Web page that contains an image at its center.
3. Create a Web page with appropriate content and insert an image towards the left
hand side of the page. When user clicks on the image, it should open another
Web page.
7
Lab Manual SESSION 4
Exercises
1. Create a Web page using href attribute of anchor tag & the attribute: alink, vlink
etc.
2. Create a Web page, wherein when the user clicks on the link it should go to the
bottom of the page.
3. Write HTML code to create a Web page of pink colour and display a moving
message in red colour.
SESSION 5
Exercises
1. Create a Web page, showing an ordered list of the names of five of your friends.
2. Create an HTML document containing a nested list showing the content page of
any book
3. Create a web page, showing an unordered list of names of five of your friends.
SESSION 6
Exercises
1. Create a Web page, which should contain a table having two rows and two
columns.
2. Fill in some dummy data in the table created by you in question 1 of this session.
SESSION 7
Exercises
1. Create the following table
Colour (White)
RED GREEN BLACK
Image 1
Image 2
Image 3
SESSION 8
Exercises
1. What are HTML Physical style tags and Logical style tags?
2. Which HTML tag allows you to scroll text on the Web page?
4. Design an HTML Page for the “Block Introduction” of this book: The page
should allow scrolling and the code should contain a comment header with your
name and enrolment number.
SESSION 9
Exercises
1. What difference does it make if we express the width of a table in percentage or
in pixel value? And how do we set the width of a particular column or cell in a
table?
1 2 3 4
5 6
Image
7 8
9 10 11 12
3. Create a Web page that should contain a table having seven rows and four
columns, along with the attributes – colspan & rowspan.
SESSION 10
Exercises
1. What are the different versions of HTML?
9
Lab Manual
SECTION 2 ADVANCED HTML
Structure
2.0 Advanced Topics of HTML
2.1 Exercises for Practice in Lab Sessions
Frame pages are basically an HTML file which break the browser window up into
separate parts or frames. In each frame a different HTML file can be loaded.
The basic idea of an HTML form is the same as that of a paper form. HTML deals
with forms exactly the same way you would with a paper form. There are groups of
items and single items all gathered together in one large form, like a paper form.
SESSION 2
Exercises
1. Write an HTML code to develop a Web page having two frames that divide the
Web page into two equal rows.
2. Write an HTML code to develop a Web page having two frames that divide the
Web page into two equal rows and then divide the second row into two equal
columns.
3. Write an HTML code to develop a Web page having frames as described in the
above question and then fill each frame with a different background colour.
SESSION 3
Exercises
1. What are the tags used to display information for browsers that do not support
frames?
3. Write a code in HTML to design a page with two frames. The frame should
10 remain proportionate even when page is resized.
SESSION 4 Advanced HTML
Exercises
1. Write the code to develop a Web page, as shown below, using frames:
2. Write the code to make the background colour of each frame in the above
question different.
SESSION 5
Exercises
1. Create a Web page having two frames, one containing links and the containing
content of the links. When link is clicked, appropriate contents should be
displayed in Frame 2.
TLC Information
3. Create a Web page using all the attributes of the frame and other tags.
SESSION 6
Exercises
1. Design a page with a text box called ‘name’ and a button with label ‘Enter.
When you click on the button another page should open, with the message
“Welcome <name>”, where name should be equal to the name entered in the
first page.
3. Set default value of ‘name’ text box of question 1 of this session to Victoria.
Add another button called Reset on click of this button name ‘text box’ should
be set to 100 default value.
SESSION 7
Exercises
1. Design a form using all input types. 11
Lab Manual 2. Create a simple form accepting:
Name
Enrolment Number
And Submit button
SESSION 8
Exercises
1. Design a Web Page, which is like ‘compose’ page of e-mail
To
Copy
Message:
Send
3. Write a code to create a Web page having radio buttons labeled as name of
colours. Clicking on each radio button should change the colour of the Web
page.
SESSION 9
Exercises
1. What is the purpose of hidden field?
SESSION 10
Exercises
1. Design a series of three HTML Pages for ABC. COM each called from the
previous one. Accept Name on the first page. When the user clicks on the enter
button, second page should open. The second page should not display the name
but a ‘Welcome screen with some information about ABC.COM. When the user
will click on the ‘next’ button it should display the name accepted in page 1 on
page 3.
(Hint: you may use hidden fields)
2. Create a Web page; divide that page into two frames. In one frame create two
links that will display different HTML forms in the other frame.
12
JavaScript
SECTION 3 JAVASCRIPT
Structure
3.0 Script Basics
3.1 Incorporating JavaScript into a Web Page
3.2 Exercises for Practice in Lab Sessions.
Today’s Web sites include graphics, sound animation, video and sometimes even
useful content! Web scripting languages, such as JavaScript, are one of the easiest
ways to spice up the Web page and to interact with users in new ways, HTML, unlike
which is a simple text markup language, which can’t respond to the user, make
decisions, or automate repetitive tasks. Web scripting languages allow you to
combine scripting with HTML to create interactive Web pages.
The <SCRIPT> tag tells the browser to start treating the text as a script, and the
</SCRIPT> tag returns to the regularly scheduled HTML as given below. Note that
the file will be stored as .html or .htm.
13
Lab Manual
In this example, we placed the script within the body of the HTML document. There
are actually four different places where you can use scripts:
• In the body of the page. In this case, the output of the script is displayed, as part
of the HTML document, when the browser loads the page.
• In the header of the page, between the <HEAD> tags. Scripts in the header
aren’t executed immediately, but can be referred to by other scripts. The header
is often used for functions.
14
• Within an HTML tag. This is called an event handler and allows the script to JavaScript
work with HTML elements. Event handlers are one type of script where you
don’t need to use the <SCRIPT> tag.
• In a separate file entirely JavaScript supports the use of files with the .js
extension containing scripts; these can be included by specifying a file in the
<SCRIPT> tag. This feature works only in Netscape Navigator 3.0 or later and
Internet Explorer 4.0 or later.
2. Embed JavaScript in HTML document asking user’s name and then printing
Hello <User_Name>
SESSION 2
Exercises
1. Evaluate the expression:
a. 7+5
b. “7” + “5”
c. 7*5
d. 7/5
e. 7%5
2. Write the segment of Script that would ask the user if he wants a greeting
message and if he does, display a Gif file called Welcome .gif and display
“Welcome to Netscape Navigator!” in the document window following the Gif
3. Write the object definition for an object called car with four properties model,
make, year & price.
SESSION 3
Exercises
1. Write a program to display a multiplication table.
SESSION 4
Exercises
1. Write a program to move a text with mouse pointer.
15
Lab Manual 3. Create a Web page using two image files, which switch b/w one another as the
mouse pointer moves over the image. Use the On Mouse over and On Mouse
out event handler
SESSION 5
Exercises
1. Write a JavaScript code to accept radius & display the area of the circle.
2. Use the date function get Date & set Date to prompt the user for an integer b/w
1 – 31 & return day of the week it represents.
3. Display time and print message accordingly e.g., ‘Good Morning’ in Morning
etc.
SESSION 6
Exercises
1. Using JavaScript create a digital clock.
SESSION 7
Exercises
1. Using JavaScript create a calculator.
SESSION 8
Exercises
1. Create an HTML form that has a number of text boxes. The user fills the
textboxes with data. Write a script that verifies that all textboxes have been
filled. If a text box has been left empty pop up an alert message indicating the
box that has been left empty. When OK button is clicked, set focus to that
specific textbox. If all the textboxes are filled, display thank you.
SESSION 9
Exercises
1. Create an HTML form that inputs employee details and display the same on the
HTML page.
2. Write a program, which prompts the user to enter a sum of two numbers and
display whether the answer is correct or incorrect.
SESSION 10
Exercises
1. Illustrate how the reset button on form functions.
SESSION 11
Exercises
1. Create a program to generate a hit counter.
16
2. Create a program to verify whether email address provided by the user is valid JavaScript
or invalid.
SESSION 12
Exercises
1. Write a program to scroll the text on status bar.
SESSION 13
Exercises
1. The form consists of two multiple choice lists and one single choice list
a. The first multiple choice list displays the major dishes available.
b. The second multiple choice list displays the stocks available.
c. The single choice list displays the miscellaneous (Milkshakes, soft drinks,
softy etc. available)
SESSION 14
Exercises
1. Create a Web page with two forms, one office copy and one customer copy
when user enters date in customer copy it gets updated in office copy.
SESSION 15
Exercises
1. Use JavaScript for authentication and verification of the textboxes in the static
site developed by the student in the HTML exercise.
17
Lab Manual
SECTION 4 VBSCRIPT
Structure
4.0 VBScript Basics
4.1 Incorporating VBScript into HTML Page
4.2 Exercises for Practice in Lab Sessions
The Web browser receives scripts along with the rest of the Web document. The
browser parses and processes the scripts. HTML was extended to include a tag that is
used to incorporate scripts into HTML-the <SCRIPT> tag.
The LANGUAGE attribute of SCRIPT tag specifies the language used for scripting.
Scripts are usually placed at the top of the Web document, in the HEAD. There are
four different places where you can use scripts:
• In the body of the page. In this case, the output of the script is displayed, as part
of the HTML document, when the browser loads the page.
• In the header of the page, between the <HEAD> tags. Scripts in the header
aren’t executed immediately, but can be referred to by other scripts. The header
is often used for functions-groups of VBScript statements that can be used as a
group.
• Within an HTML tag. This is called an event handler and allows the script to
work with HTML elements. Event handlers are the one type of script where you
don’t need to use the <SCRIPT> tag.
• In a separate file entirely.
Not all browsers support scripting languages. To handle such browsers you can
enclose your script in comment tags (<!-- and -->).
2. Create a Web page that displays a message box with the message:
“Welcome to my Website”
SESSION 2
Exercises
1. Write a VBScript code that accepts the length, breadth and height and displays
the area of a rectangle.
SESSION 3
Exercises
1. Write a programme, which prompts, the user to enter the sum of two numbers
and display whether the answer is correct or incorrect.
SESSION 4
Exercises
1. Create a programme to check for null or empty string.
2. Create a form that has an e-mail field. Now write VBScript code for validation
of the email address.
SESSION 5
Exercises
1. List the Mouse and Keyboard events in VBScript.
SESSION 6
Exercises
1. Create a form in HTML containing the following fields and then perform the
validation of each field using VBScript.
Name - textbox
Address - textbox
Date of Birth - a combo box (one for each, day, month and
year)
Email - textbox
2. How do you declare variables in VBScript and enlist the various variables-
naming rules.
19
Lab Manual SESSION 7
Exercises
1. What is the purpose of Option Explicit in VBScript code?
2. Using an HTML form accept the Principal, Rate of Interest and Time from the
user, validate the three fields and then display the Simple Interest to the user.
SESSION 8
Exercises
1. Create a programme that accepts the time from the system clock and
accordingly displays a Good Morning, Good Afternoon or Good Evening
message to the user. Use If – Then – Else statement.
SESSION 9
Exercises
1. Write a programme in VBScript that uses For..Next looping statement to create
a Fibonacci series.
SESSION 10
Exercises
1. Write a programme that displays the multiplication of two matrices.
3. Write a programme that accepts a number from the user and displays its
factorial only if it is a prime number.
20
Dreamweaver
SECTION 5 DREAMWEAVER
Structure
5.0 How to Work in Dreamweaver?
5.1 How to Save your File?
5.2 Menu
5.3 Adding Layers to the Timeline and Giving Motion to the Layer.
5.4 Inserting Scripts
5.5 Inserting External Media in the Web Page
5.6 Adding SSI (Server-side include to the Page)
5.7 Adding CSS Style to your Page
5.8 Adding XML Files to your Page
5.9 To Export a Dreamweaver Document as XML File
5.10 Exercises for Practice in Lab Sessions.
21
Lab Manual
On opening Dreamweaver you will see 3 main windows, (1) Object; which contains
Character, Common, Forms, Frames, Head and Invisible. Many options are available
under these, like under common where you will get, insertion of image, rollover
image, layer, tabular data, horizontal bar, line break, email link, date, flash movie,
fireworks object, shockwave file, generator, plug-ins, active x controls, SSI etc.
under character in which you will find some special character/symbols like ©, ®, £,
¥, ™ etc; under frames where you will find different type/style of frames; under
forms where you will find all the elements of forms, like text box, password box,
radio button, check box, selection box, jump menu, submit & reset button etc. (2)
Properties; which provides the properties of the selected object/item, page properties
etc; (3) Launcher; which contains: Site, Library, HTML Style, CSS Style,
Behaviours, History, HTML Source; On clicking any of the items on the Launcher
the subsequent window opens up.
Before creating your Web page you have to create a Root directory in which all of
your work will be saved. Then in Dreamweaver create a Site and Provide the Root
Directory (which you have created). To do this:
Step 1: Select Site from Launcher window
Step 2: Click on Define Site
Step 3: Click on NEW
Step 4: Give a name under “Site Name”
Step 5: Select the folder by browsing under “Local root folder”
Step 6: Click on OK
Step 7: Click on DONE
5.2 MENU
File Menu: Under it we have New, Save, Save as, Save as template, Import, Export,
Preview in browser etc. options.
Edit Menu: In this menu we have Cut, Copy, Paste, Undo, Redo, Select all, Find,
Replace, Preference etc. options which help us in editing the document.
View Menu: Rulers, Grids, Plugins etc. are available under this.
Insert Menu: It contains almost all the things, which are there, in the Object tool bar.
Modify Menu: Under this we have Page properties, selection properties, Make link,
remove link, link target, table, layer, frameset, library, template, timeline, translate
etc. This menu helps to modify the page by choosing the option as per requirement.
Text Menu: It helps to format the text written in the page by providing details, such
as indent, outdent, list (ol, ul, dl), alignment, font, style, size, size increase, size
22
Dreamweaver
decrease, HTML style, CSS style, colour etc. It also provides the facility to check the
spellings in the page.
Site Menu: This menu contains site files, site map, new site, open site, define site
options.
Window Menu: It contains all the different windows, like object, properties,
launcher, site file, site map, CSS, timeline, history, behaviour, layer, frame, library,
template etc.
23
Lab Manual
On choosing (a) of step 4 you will get a new screen in which you have to provide the
following details in Category:
i. Type: Provide the Font, Size, Style, Weight, Decoration, then click OK
ii. Background: provide a Colour or insert an image, then click OK
iii. Block: Give the alignment style, then click OK
iv. Box: Provide the margin setup of Top, Left, Right & Bottom, then click OK
v. Border: Provide the width & colour, then click OK
vi. List: Select the list type (OL, UL, DL), then click OK
vii. Positioning: Provide the style, Visibility, Z-index, Placement (Top, Left, Right
& Bottom), click OK.
After providing the details, select the style from the CSS style window. Choose
where to apply this style (body, p, layer etc.), by clicking on Apply button in the CSS
style window.
When an XML file is imported, Dreamweaver merges the XML content into the
Template, which is being specified in the XML file and shows the result in the
document window of Dreamweaver. If that specified Template is not found, then
Dreamweaver prompts you to select another Template for use.
The XML file should contain the name of the Template and editable region as XML
tags.
Example:
<doctitle>
<![CDATA[<title>newTemplate</title>]]>
</doctitle>
<Edit-Region>
24
Dreamweaver
<![CDATA[{Edit-Region}]]>
</Edit-Region>
Here doctitle identifies the title of the Template and edit-region identifies the editable
region.
But in a standard Dreamweaver file XML tags use the “item name”. The above
example (XML tags) is given below in standard Dreamweaver file:
<item name="doctitle">
<![CDATA[ <title>newTemplate</title>]]>
</item>
<item name="Edit-Region">
<![CDATA[{Edit-Region}]]></item>
</item>
Here “item name=doctitle” identifies the title of the Template and “item name=edit
region” identifies the editable region.
When the document is exported, the generated XML file contains the name of the
Template the document is using and all editable region names.
2. Design a Home page for a Toy Company. The page has an image as the
background. Do some attractive text formatting to the text written in the page.
3. Insert an image in your page. Give a zigzag motion to the image in your page.
(Hint: Using timeline)
SESSION 2
Exercises
1. Insert an image in a page. In the browser, when you take cursor over it, another
image emerges under it and when you click on the second image, it takes you
to exercise 2 of session 1.
2. Design a Web page which contains details about your TLC. Give links to a few
options. Also make a link “Mail Us”. On clicking this, it will open the
compose box for mailing to “[email protected]”.
25
Lab Manual
SESSION 3
Exercises
1. Show the course contents of HND in a table.
SESSION 4
Exercises
1. Design a form as shown below:
2. a. Include an SSI file in your document. Show the SSI file in this document.
b. Include an SSI file in your document. Don’t show the SSI file in this
document.
SESSION 5
Exercises
1. Show the course contents of HND in a table using XML and not HTML.
26
Dreamweaver
SESSION 6
Exercises
1. Create a website that divides the Web page into two unequal frames. In Frame
One, there are two links to two different forms. The forms are validated on
submitting and the result is shown at the bottom of the same page. Use CSS for
formatting.
SESSION 7
Exercises
1. Design a form, which has a list menu. On selecting any item from that menu it
jumps to the related page. Insert a “GO” button alongside the list menu.
SESSION 8
Exercises
1. Make a Web page to include:
1) a background image,
2) set the text colour to blue,
3) make 2 logos, link them to the IGNOU home page,
4) set the colour of all other text links black. (Use Hexadecimal
colour values rather than named colours).
Use Cascading Style Sheets to develop the above Web page
27
Lab Manual
</table>
<table>
<tr>
<td>
<input type="Button" value="Home">
<input type="Button" value="Contact Us">
<input type="Button" value="Feedback">
<input type="Button" value="Email">
<input type="Button" value="Help">
</td>
</tr>
</table>
</body>
</html>
SESSION 9
Exercises
1. Develop a Web page with the following enhancements:
• A rollover effect, where an image changes if the user places the mouse
over it.
• An animation that occurs in response to the user clicking on an image.
• A pull-down menu with each option linking to a specific page.
2. Design a Web page. Integrate images, audio, video and animation all in one
page.
SESSION 10
Exercises
1. Design a website about yourself (minimum 5-7 pages).
2. Design the home page using Frames. The top frame will contain a Flash
animation file (showing pictures of you from childhood to till date), the left
frame will contain all the links and the right page will contain “Welcome to
My Home Page”. When clicked on the links the related page will open in the
right frame.
28