unit 2.2 part 1

22
Unit 2 – HTML Basics Presentation 1 Web Programming

Post on 21-Oct-2014

372 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Unit 2.2 Part 1

Unit 2 – HTML Basics

Presentation 1

Web Programming

Page 2: Unit 2.2 Part 1

Revision…

1. Define the term Internet.

2. List the requirements to get Internet connection.

3. Define the term E-commerce.

4. State the use of Forward button in IE.

5. Expand WWW and URL.

Page 3: Unit 2.2 Part 1

Objectives

At the end of this presentation, you will be able to• Outline the structure of HTML document• Create HTML document• Execute HTML document in a Web browser• Correct the errors in HTML document

Page 4: Unit 2.2 Part 1

Introduction - HTML

• Web Browser reads the instructions from a file.

• It displays the document in the browser window according to the instructions given in the file.

• Instructions are given in a language called HTML.

• File is HTML file.

Page 5: Unit 2.2 Part 1

Introduction (Contd...)

<html><head><script language=javascript>var now=new Date,t1=0,t2=0,t3=0,t4=0,t5=0,t6=0,ie5=0,hp=0,ao=0,cc='';t1=now.getTime();function err(a,b,c) {var img=new Image;img.src='http://srd.yahoo.com/hp5-err/'+escape(a)+','+escape(b)

B

R

O

W

S

E

R

HTML File Web Page

Page 6: Unit 2.2 Part 1

Structure of HTML

<HTML> <HEAD> <TITLE> ---------- </TITLE> </HEAD> <BODY> --------------- --------------- --------------- </BODY></HTML>

Contains some fundamental information about the Web page.

Title of the Web page is given here.

Contains the tags that specify how the content should be displayed.

Specifies to the browser that the code enclosed is a HTML code.

Head Section

Body Section

Page 7: Unit 2.2 Part 1

Creating a HTML document• Open

Notepad • Type the

HTML code• Save the file

with extension .html in a folder (C:\HTML\ Misc folder)

<HTML><HEAD><TITLE> The Mind </TITLE></HEAD><BODY> <FONT SIZE=5> <CENTER> <H1 ALIGN=CENTER> The Mind </H1> Great minds think about ideas <BR> Medium minds speak about happenings <BR> Small minds gossip about others. </FONT></CENTER></BODY></HTML>

Page 8: Unit 2.2 Part 1

Creating a virtual directory

To store HTML documents in IIS, you have to create a directory known as Virtual Directory.

1. Click Start Control Panel.

2. Select Performance and Maintenance

3. Select Administrative tools

Page 9: Unit 2.2 Part 1

Creating a virtual directory (Contd..)

4. Select IIS. Internet Information Services dialog box is displayed.In the left pane, right click Default Web site in the Web sites folder and select New Virtual Directory. Virtual Directory Creation Wizard is displayed.

5. Click the Next button.6. In the Alias text box, type the Virtual

Directory name, say HTML and click the Next button.

Page 10: Unit 2.2 Part 1

7. In the Web site content directory page, browse and select the path of the directory that contains the HTML files, say C:\HTML.

8. With the default settings in the Access Permissions page, click the Next button.

9. Click Finish to complete the Virtual Directory Creation wizard.

Creating a virtual directory (Contd..)

Page 11: Unit 2.2 Part 1

Opening the HTML document

1. To view the Web page, open Internet Explorer.

2. Type the URL of the Web page created, in the address bar http://localhost/HTML/Misc/Structure.HTML

3. Press the Enter key.

4. The browser interprets the instructions given in the HTML file.

Page 12: Unit 2.2 Part 1

Opening the HTML document

The Web page is displayed in the browser window.

Page 13: Unit 2.2 Part 1

Lab Exercise

1. Open D2_1.html in Internet Explorer. The following code will be present in D2_1.html.

a. Find out the tag which is used to display First Web Page in the title bar.

b. Which tag is used to display Welcome in the source code of D2_1.html?

c. Which tag is used to display the contents of the Web page?

d. What is the name of the Web page?

Page 14: Unit 2.2 Part 1

Correcting the mistakes

1. Click the View Source option. The source code (HTML code) of the Web page is displayed in the Notepad file.

2. Make the necessary corrections.

3. Save and close the file.

4. Click the Refresh button in Internet Explorer.

Page 15: Unit 2.2 Part 1

Tags

• Instructions given to a Web browser.• Enclosed within angled brackets (< >). • Starting tag - Indicates the starting point of an

effect. For example, <HEAD>.• Ending tag - Indicates the ending point of an

effect. The ending tag is enclosed within angled brackets and is preceded by a slash (/). For example, </HEAD>.

• The effect of the tag is applied to the content which is placed inside the starting and ending tags.

Page 16: Unit 2.2 Part 1

Lab Exercise

2. Open D2_1.html in Notepad.a. Change title as Welcome to My First Web

Page. Display the output in Internet Explorer.

b. Remove the <Title> tag from D2_1.html and save the file. Display the output in Internet Explorer and observe the difference.

Page 17: Unit 2.2 Part 1

Lab Exercise (Contd..)

c. Change the head tag to Welcome to HTML page. Display the output in Internet Explorer and observe the difference.

d. Change the body text to This is my First HTML page. Display the output in Internet Explorer and observe the difference.

Page 18: Unit 2.2 Part 1

Lab Exercise

3. Write a HTML code to display the output as given in the following figure.

Page 19: Unit 2.2 Part 1

Lab Exercise

4. Write a HTML code to display the output as given in the following figure and save the file as Welcome.html.

Page 20: Unit 2.2 Part 1

Summary

In this presentation, you learnt the following:• A Web page is an electronic document that

contains information in the form of text, pictures, audio or video.

• HTML is a language that instructs the browser how to display the contents of a Web page in the browser window.

• The source code of a Web page can be viewed by selecting View Source in the Internet Explorer.

Page 21: Unit 2.2 Part 1

Summary

• The instructions given to a Web browser are called Tags.

• The text given in the TITLE section will appear in the title bar of the browser window.

Page 22: Unit 2.2 Part 1

Assignment

1. Give the expansion of HTML.

2. List the steps to be followed while correcting the errors in a HTML document.

3. List the steps to be followed in creating a virtual directory.

4. Define the term Tag.