Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML...

48
Lecture 3 Creating a Web Page with HTML

Transcript of Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML...

Page 1: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Lecture 3Creating a Web Page with HTML

Page 2: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

ObjectivesHypertext Document in WWW p1.4-1.5The HTML language p.1.8-1.10

Definition Web browsers and HTML Versions of HTML Tools for creating HTML documents HTML syntax Examples of HTML tags Basic tags

Page 3: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Objectives (con’t)Creating: p.1.11-1.34

• Headings• Paragraphs • Lists• Character tags• Special characters• Horizontal lines• Graphic images

Exercises

Page 4: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Hypertext Document in WWW

A hypertext document is an electronic file that contains elements that a user can select, usually by clicking a mouse, to open another document.

Liner VS. hypertext document

Page 5: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Hypertext Markup Language (HTML)Definition: Language used to create and

format Web pages, using a set of special codes, called tags

HTML doesn’t describe how text looksHTML uses a code that describes the

function the text has

Page 6: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Web browser & HTML

A Web browser interprets the codes to determine a document’s appearance

Different browsers might display a document differently

Page 7: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

An Example: A HTML file displayed by two browsers [ref.]

Page 8: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Why different browsers display a web document differently ?Portability

different computer platforms different types of fonts supported e.g. Arial, Gothic different I/O devices:

• chunky teletypes• high-end workstations• non visual media such are speech and Braille

Advantage: frees web page authors worrying about compatibility on different computers and operating systems

Page 9: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Why different browsers display a web document differently ? (con’t)

Speed exact specification on how to display

each character dramatically increase• file size

• the time to transfer

Page 10: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Versions of HTMLHTML has a grammar or set of rules called

syntaxThe specifications or standards have been

developed by a consortium of web authors, software companies and interested users (World Wide Web Consortium W3C)

Extensions are supported by some browsers to add new possibilities to HTML

Page 11: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Versions of HTML (con’t)

5 versions of HTML [ref.]

HTML 0.0

HTML 1.0

HTML 2.0

HTML 3.2

HTML 4.01

Page 12: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

HTML 4.01 Adds support for style sheets, new features to tables and forms ...

Page 13: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Tools for Creating HTML Documents

HTML documents: text filesTools:

Text editor e.g. MS note pad HTML convertor e.g. MS Word HTML editor Other design tools: MS FrontPage,

Macromedia Dreamweaver

Page 14: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

HTML syntax2 elements:

Document content• Parts that the user sees

Tags• HTML codes that indicate the docume

nt content

Page 15: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

HTML syntax (con’t)<Tag Name Properties> Document Content </Tag

name>e.g. <H1 ALIGN=CENTER>Mary Taylor<H1>A tag contains

brackets (< >) that enclose the tag name properties (optional)

• additional information that defines the tag’s appearance

Document content: parts the user sees

Page 16: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

HTML syntax: Two-side tags

Two-sided tags require both opening and closing tags

e.g.

<H1 ALIGN=CENTRE> Mary Taylor </H1>• opening tag: tells the browser to turn on the

feature and apply it to the document content that follows

• closing tag: turns off the feature

Page 17: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

HTML syntax: One-sided tagsrequire only the opening tag e.g. <LI>, <IMG>

<OL><LI>Graduated May, 1996. M.A. International <LI>Grade Point Average: 3.5 overall, 3.9 in major</OL>

<IMG SRC= “Taylor.gif”>

Page 18: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

HTML syntax characteristicsTags are NOT case sensitive

H1=h1

HTML ignores extra blank space, blank lines or tabs

Page 19: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

HTML syntax characteristics (con’t) The following HTML statements are the

same: <H1>To be or not to be. That is the question.</H1> <H1>To be or not to be. That is the

question.</H1> <H1>To be or not to be. That is the question.</H1>

Page 20: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Examples of HTML tags

Page 21: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Examples of HTML tags (con’t)

Page 22: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Basic Tags (example)

Displayed at the title line

<Head>: surround information about the Web page

<Body>: surround the part that appears in the browser

Page 23: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Example Result: Basic Tags

Page 24: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Creating Headings

6 levels<Hy properties>Heading text</Hy>

where y is a heading numbered 1- 6

Page 25: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Example: Headings

Page 26: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Example: Creating headings

Page 27: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Example Result: Headings in the browser

Page 28: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Creating a paragraphSyntax:

<P>text</P>

Page 29: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Example: paragraph text (no <P> tag)

Page 30: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Example Result: Text Not separated into paragraphs

Page 31: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Example: <P> tag for paragraphs

<P>Satellite Technician (Front Range Media Inc. 1993-1994): Monitored satellite uplink/downlink procedures to assure quality video transmissions. Aided technicians with transmission problem. Associated in the assembly and maintenance of uplink facility.</P>

<P>Technical Assistant(Mountain View Bank 1992-1993):Managed data cessing system. Handled user requests anf\d discussed programming option Managed delivery service</P>

<P>Salesperson(Computer Visions 1991): Sales and customer support in computers and electronics. Managed commercial accounts in Mountain View and Crabtree locations.</P>

Page 32: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Example result: paragraphs with <P> tag

Page 33: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Creating lists: Ordered listList in numeric orderExample:

<OL><LI>Graduated May, 1996. M.A. International Telecommunications<LI>Grade Point Average: 3.5 overall, 3.9 in major<LI>Dean’s List: September 1994-May 1996<LI>Member, Phi Alpha Omega Honor Society </OL>

Result:

1. Graduated May, 1996. M.A. International Telecommunications

2. Grade Point Average: 3.5 overall, 3.9 in major

3. Dean’s List: September 1994-May 1996

4. Member, Phi Alpha Omega Honor Society

Page 34: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Creating list: Unordered listList in which list items have no particular order.Example:

<UL><LI>Graduated May, 1996. M.A. International Telecommunications<LI>Grade Point Average: 3.5 overall, 3.9 in major<LI>Dean’s List: September 1994-May 1996<LI>Member, Phi Alpha Omega Honor Society</UL>

Result: Graduated May, 1996. M.A. International Telecommunications Grade Point Average: 3.5 overall, 3.9 in major Dean’s List: September 1994-May 1996 Member, Phi Alpha Omega Honor Society

Page 35: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Character tagsDefinitions:Character tag: A tag that is applied to an

individual characterLogical tag: Indicates how you want to use

text, not necessarily how want it displayedPhysical tag: Indicates exactly how

characters are to be formatted

Page 36: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Common Logical tagsIt indicates how you want it displayed.

Page 37: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Example: Logical tags

Page 38: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Common Physical tags

Page 39: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Example: Physical Character tags

Page 40: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Example: Applying character tags

Page 41: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Example result: Applying character tags

Page 42: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Special characters

Page 43: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Example: Special characters<H5 ALIGN=CENTER>11 Kemper Ave. &#

183 Lake View, CO 80517 &#183 (303 555-1012</H5>

Result:

Page 44: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Horizontal lines <HR ALIGN=CENTER SIZE=12 WIDTH=100%> <HR ALIGN=CENTER SIZE=6 WIDTH=50%> <HR ALIGN=CENTER SIZE=3 WIDTH =25%> <HR ALIGN=CENTER SIZE=1 WIDTH=10%>

Page 45: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Example: Horizontal lineAfter the end of Mary’s address line, press

Entertype <HR>Result:

Page 46: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Inserting a graphic

Two types Inline image External image

Page 47: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

Inline imageappears directly on the Web pageloaded when the page is loaded2 types supported by all browsers:

GIF (Graphical Interchange Format) JPEG (Joint Photographic Experts Group)

Syntax:

<IMG SRC= “filename”> e.g. <IMG SRC=“Taylor.gif”>

Page 48: Lecture 3 Creating a Web Page with HTML. Objectives §Hypertext Document in WWW p1.4-1.5 §The HTML language p.1.8-1.10 l Definition l Web browsers and.

External imageNot displayed with the Web pageBrowser must have a file viewer e.g. Shockwave