HTML Lesson 5

27
HTML Lesson 5 TBE 540

description

HTML Lesson 5. TBE 540. Prerequisites. The user must be able to… Create basic web pages with a text editor and/or a web page editor. Objectives. After completing all activities related to this lesson, the learner will be able to… Describe the use of relative addressing. - PowerPoint PPT Presentation

Transcript of HTML Lesson 5

Page 1: HTML Lesson 5

HTML Lesson 5

TBE 540

Page 2: HTML Lesson 5

Prerequisites The user must be able to…

– Create basic web pages with a text editor and/or a web page editor.

Page 3: HTML Lesson 5

Objectives After completing all activities related to

this lesson, the learner will be able to…– Describe the use of relative addressing.– Insert a table in a web page.– Format the table and fill it with information.– Create a frameset document and

accompanying pages.– List advantages and disadvantages of

tables and frames.

Page 4: HTML Lesson 5

Relative Addressing Though putting all web site files in the

same folder is the simplest method, it is more common to organize the file into folders.

For example, all graphics (especially those common to several pages) might be placed in a folder called IMAGES

Page 5: HTML Lesson 5

Relative Addressing Relative addressing means that you will

specify a “path” when you specify file names.

Here are two IMG tags that show graphic files in a location other than the folder that contains the page:

<IMG SRC=“IMAGES/cow.gif”> <IMG SRC=“../IMAGES/cow.gif”>

Page 6: HTML Lesson 5

Relative Addressing <IMG SRC=“IMAGES/cow.gif”> means

that there is a folder called IMAGES inside the folder where the page is. The image cow.gif will be there.

<IMG SRC=“../IMAGES/cow.gif”> means to “go up one level” (../) then look for a folder called IMAGES. The image cow.gif will be there.

Page 7: HTML Lesson 5

Relative Addressing Here is a sample site organization:

MySite

IMAGES

cow.gifsheep.gifback.gifarrow.giffarm.htm

animals

home.htm

Page 8: HTML Lesson 5

Relative Addressing

To put back.gif into home.htm, the IMG tag in home.htm would be:

<IMG SRC=“IMAGES/back.gif”> To put back.gif into farm.htm, the IMG

tag in farm.htm would be:

<IMG SRC=“../IMAGES/back.gif”>

Page 9: HTML Lesson 5

Tables A web page table is very much like a

table in word processing or a spreadsheet.

It has rows, columns and cells.

Number Cost Total

10 $1,000 $10,000

5 $25,000 $125,000

Page 10: HTML Lesson 5

Tables When tables are created, most web

editors will ask for the number of rows and columns.

You can change these settings later. You may also want to set the border (0

= “invisible”, 3 or more gives a 3-D effect).

Page 11: HTML Lesson 5

Tables Tables are often used to line up text

and/or graphics. These tables often have a border of 0.

border=1

border=0

Page 12: HTML Lesson 5

Tables Most commercial web pages use tables

to arrange graphics and text exactly as the designer planned it.

Many pages use tables within tables (a larger table with smaller tables inside its cells).

Page 13: HTML Lesson 5

Tables (CSUDH Homepage)

Click to see the tables

Page 14: HTML Lesson 5

Tables (CSUDH Homepage)

Page 15: HTML Lesson 5

Frames In web pages, frames are areas into

which whole web pages can be loaded. Though frames are not commonly used

(most sites use tables instead), Blackboard is a good example of the use of frames.

Click to see examples of Blackboard frames.

Page 16: HTML Lesson 5

Frames - Blackboardstays here all the time

changes when you click the buttons

stays while you are in a class area

Page 17: HTML Lesson 5

Frames The Blackboard page you just looked at

is made from four web page documents. Each of the three frames is a separate

web page file. There is a FRAMESET document (also

a web page file) that sets up the frames.

Page 18: HTML Lesson 5

Frames A FRAMESET document uses <FRAMESET>

and </FRAMESET> instead of <BODY> and </BODY>.

The type of frames (rows or columns) must be specified, and each frame must be described with a <FRAME> tag like this:

<FRAME SRC =”content1.htm" border="0" NORESIZE >

Page 19: HTML Lesson 5

FRAMESET Sample Here is the FRAMESET

code for the example --><HTML>

<HEAD></HEAD>

<FRAMESET COLS=“100,*”>

<FRAME SRC=“left.htm”>

<FRAME SRC=“right.htm”>

</FRAMESET>

</HTML>

Links•One•Two•Three

WELCOME!

Join us..etc.

left.htm

right.htm

Page 20: HTML Lesson 5

FRAMESET Sample<HTML>

<HEAD></HEAD>

<FRAMESET COLS=“100,*”>

<FRAME SRC=“left.htm”>

<FRAME SRC=“right.htm”>

</FRAMESET>

</HTML>

Two “column” frames - the first (left) is 100 pixels wide. The right frame takes up whatever space is left over (*) on the screen.

left.htm is the web page file for the left frame.

right.htm fills the right frame.

Page 21: HTML Lesson 5

Try this! For more information on frames and

tables, see the links from the class page: http://www.csudh.edu/fisher/tbe540/540html.htm

Try the hands-on exercise to experiment with tables.

Page 22: HTML Lesson 5

Self Check HTML Lesson 5 You are working on a web page in the

HOME folder, and you want to include a picture called me.jpg that is stored in the PIX folder (inside the HOME folder). Which is the correct pathname?

<IMG SRC=“../PIX/me.jpg”>

<IMG SRC=“PIX/me.jpg”>

<IMG SRC=“IMAGES/me.jpg”>

Page 23: HTML Lesson 5

Self Check HTML Lesson 5 You are working on a web page in the

HOME folder, and you want to include a picture called me.jpg that is stored in the PIX folder (inside the HOME folder). Which is the correct pathname?

<IMG SRC=“../PIX/me.jpg”>

<IMG SRC=“PIX/me.jpg”>

<IMG SRC=“IMAGES/me.jpg”>

Page 24: HTML Lesson 5

Self Check HTML Lesson 5 What is the format of the table below?

3 rows, 2 columns, border=2

2 rows, 3 columns, border=0

2 rows, 3 columns, border=2

Page 25: HTML Lesson 5

Self Check HTML Lesson 5 What is the format of the table below?

3 rows, 2 columns, border=2

2 rows, 3 columns, border=0

2 rows, 3 columns, border=2

Page 26: HTML Lesson 5

Self Check HTML Lesson 5 Does the display below show the use of

tables or frames? How can you tell?

LEFT

SIDE

RIGHT SIDE

1

2

3

4

5

Page 27: HTML Lesson 5

Self Check HTML Lesson 5 Does the display below show the use of

tables or frames? How can you tell? Right side moves, but left side stays as is.

LEFT

SIDE

RIGHT SIDE

1

2

3

4

5