Top Banner
COMP 14: HTML & the Web June 20, 2000 Nick Vallidis
23

COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Dec 20, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

COMP 14: HTML & the Web

June 20, 2000Nick Vallidis

Page 2: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Announcements

P5 due todayP6 due Friday

Page 3: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Homework

read 1.6 (p. 40-41), 2.9-2.10 (p. 92-100), 3.10 (p. 157-164), 4.7 (p. 211-212)

It's not a lot of pages, they're just scattered about… basically, it's most of the pages with the orange on the edge for the first 4 chapters.

Page 4: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Today

The webWriting HTML

Page 5: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

The Internet

a group of computers in the same location are connected by a network called a local-area network (LAN) UNC is a good example of a LAN. A LAN is usually owned by one company

Multiple LANs are connected to form a wide-area network (WAN) the Internet is a WAN that spans the globe

Page 6: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Talking over the Internet

A protocol is like a language to a computer. It's the language it speaks over a network.

The internet uses a pair of protocols called TCP/IP TCP = Transmission Control Protocol IP = Internet Protocol

Page 7: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Internet addressing

Every computer on the internet has two addresses: IP address

These take the form 192.154.67.1Four numbers from 1-255 separated by periods

Internet addresstake the form evans.cs.unc.eduThe first word is the name of the machinethe rest of the words are collectively called "the

domain"

Page 8: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

the World Wide Web

a way to facilitate information transfer over the Internet

based on the concept of hypertext - that information doesn't follow a linear flow like it's presented in a book

the users of the Web have settled on HTML (HyperText Markup Language) as the way to represent hypertext

Page 9: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Using the web

You need a program called a web browser - these basically understand HTML and how to retrieve information through the Internet

You need the address of the information you want. This is called a Uniform Resource Locator (URL) http://computer.unc.edu/blah/blah.html ftp://ftp.cs.unc.edu/public/application.doc

Page 10: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Writing Web Pages

In order to create a web page, we have to learn how to write HTML.

HTML is NOT a programming language.

HTML just tells the computer how to format text and images--it's like using Word, but having to type in what you want things to look like.

Page 11: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Tags

HTML works based on the concept of tags. A tag is some text surrounded by < and >

Tags are not printed to the screenExample tags:

<HTML>, <TITLE>, <P>, <H1>A lot of the time they work in pairs:

<HTML> and </HTML>

Page 12: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Very simple web page

<HTML><HEAD><TITLE>Simple web page</TITLE></HEAD><BODY>This is the text on a web page.</BODY></HTML>

Page 13: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

What do the tags mean?

<HTML>, </HTML> - go at the beginning and end of EVERY page

<HEAD>, </HEAD> - introduction of the document

<TITLE>, </TITLE> - what goes in the title bar of the window

<BODY>,</BODY> - the text (and other stuff) that is displayed in the window

Page 14: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Doesn't matter how you type it...

In HTML, where you put enter is ignored. The web browser decides this for you based on the size of the window

These two will print the same thing:first:<BODY>Why not fly?</BODY>

second:<BODY>Whynot fly?</BODY>

Page 15: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

How do you do it then?

Putting <P> at the beginning of a paragraph and </P> at the end will put a blank line between two pieces of text example

You can also use <BR> to insert a carriage return (aka <enter>) example

Page 16: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

What else can I do?

make text bold - use <B> and</B>make text italic - use <I> and </I>make text blink - use <BLINK> and

</BLINK> really annoys the heck out of people too!

center text - <CENTER> and </CENTER>

many others on p. 582 in the book

Page 17: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Hierarchical structure

For documents having a hierarchical structure, you can use heading tags <H1> marking chapter in a book <H2> marking section of a chapter <H3> marking subsection of a chapter <H4> and so on down... <H5> <H6>

Page 18: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Lists

There are two kinds of lists: Ordered lists (surrounded by <OL> and

</OL> Unordered lists (surrounded by <UL>

and </UL>Both use <LI> and </LI> to indicate

List Items (things in the list)example

Page 19: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Links!

This is the important part. This is how you go from page to page.

<A HREF=put URL here>link text</A>

Example

Page 20: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Color and images

You can add color or an image to the background: color: make body tag <BODY

BGCOLOR=RED> OR<BODY

BGCOLOR="#FF23FF"> image: make body tag <BODY

BACKGROUND="image.gif">

Page 21: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Inserting images

You can also just add an image into the middle of the page

Use <IMG SRC=put URL here>

It's that easy! Here's the example

Page 22: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Applets

Use the <APPLET> tagIt has some attributes you need to set:

<APPLET code=!!! HEIGHT=!!! WIDTH=!!!> (you need to fill in the !!!)

there's also a CODEBASE to tell where the code is (in case it's not on your machine)

Example: <APPLET CODE=Marquee WIDTH=100

HEIGHT=50></APPLET>

Page 23: COMP 14: HTML & the Web June 20, 2000 Nick Vallidis.

Parameters to applets

Sometimes applets need parametersUse the <PARAM> tag before

</APPLET>Example:

<APPLET CODE=Map WIDTH=100 HEIGHT=5><PARAM NAME="state" VALUE="North Carolina"><PARAM NAME="city" VALUE="Chapel Hill"></APPLET>