You are on page 1of 7

Basic HTML Part 1: Basic Web Page Production

By Kathy Schrock

c1999 Kathleen Schrock (kathy@kathyschrock.net)

1

c1999 Kathleen Schrock (kathy@kathyschrock.net)

2

Basic Web page creation
n n n

Basic HTML tags
<HTML> <HEAD> <TITLE> </TITLE> </HEAD> <BODY> </BODY> </HTML>

n

Basic HTML tags Heading tags Paragraph and break tags Text alignment

n n n n

Background color Text color Horizontal rules Bold and italic

c1999 Kathleen Schrock (kathy@kathyschrock.net)

3

c1999 Kathleen Schrock (kathy@kathyschrock.net)

4

Heading tags
Used to denote main headings and subheadings; go from 1 to 6 n Show relative importance of information <H1>This is H1</H1> This is H1 <H2>This is H2</H2> This is H2 <H3>This is H3</H3> This is H3 <H4>This is H4</H4> This is H4
n
c1999 Kathleen Schrock (kathy@kathyschrock.net) 5

Paragraph and break tags
n n

<P></P> surround a paragraph of info Skips a line and starts a new paragraph <BR> (single-sided tag) Starts the next word on the next line No space left between lines
c1999 Kathleen Schrock (kathy@kathyschrock.net) 6

n n n

1

Text alignment
n n

Background color
n n

The default is that all text is left-aligned To align paragraphs, you can add to the paragraph tag <P align=center> </P> To center whole blocks of text, just use <CENTER> </CENTER>

n

n

Attribute added to the <BODY> tag There are 16 color names you can add (red, blue, yellow, etc.) or you have to know the hexadecimal code Examples
<BODY BGCOLOR=“red”> <BODY BGCOLOR=“#00FFFF”>

c1999 Kathleen Schrock (kathy@kathyschrock.net)

7

c1999 Kathleen Schrock (kathy@kathyschrock.net)

8

Changing the text color
n n n

The horizontal rule
n n n n

Same codes as for background color Attribute of the body tag, too Example would lead to a light blue page with dark purple text
<BODY BGCOLOR=“#00FFFF” TEXT=“#800000”>

Used to separate portions of a page A one-sided tag Can include a % attribute Example
<HR> <HR WIDTH=50%>

c1999 Kathleen Schrock (kathy@kathyschrock.net)

9

c1999 Kathleen Schrock (kathy@kathyschrock.net)

10

Bold and italic
n n n

Used to emphasize text Two-sided tags Examples
<B>This is bold</B> <I>This is italic</I> This is bold This is italic

Part 2: Creating Lists

c1999 Kathleen Schrock (kathy@kathyschrock.net)

11

c1999 Kathleen Schrock (kathy@kathyschrock.net)

12

2

Lists
n n n

Bulleted (unordered) list
Good for drawing attention to items that are in no particular order <UL> <LI>Dogs * Dogs <LI>Cats * Cats </UL>
n
13 c1999 Kathleen Schrock (kathy@kathyschrock.net) 14

Bulleted lists Numbered lists Definition list

c1999 Kathleen Schrock (kathy@kathyschrock.net)

Numbered (ordered) lists
Great for describing sequential tasks or step-by-step procedures <OL> <LI>Phase 1 1. Phase 1 <LI>Phase 2 2. Phase 2 </OL>
n
c1999 Kathleen Schrock (kathy@kathyschrock.net) 15

Definition list
Includes a statement of the word and followed by the definition <DL> <DT>Cirrus Cirrus <DD>high wispy high wispy <DT>Nimbus Nimbus <DD>dark dark </DL>
n
c1999 Kathleen Schrock (kathy@kathyschrock.net) 16

Links and navigation
n

Relative links
– Links in your own directory

Part 3 : Links and Navigation
n n

Absolute links
– Links located on another server

Changing link color

c1999 Kathleen Schrock (kathy@kathyschrock.net)

17

c1999 Kathleen Schrock (kathy@kathyschrock.net)

18

3

Relative links
n

Absolute links
n

n

Give you the name of the file you want to access in relation to the page you are on If index.htm and page2.htm are in the same directory, the link on the index page to page 2 would look like this
<A HREF=“page2.htm”>Go to page 2</A>
c1999 Kathleen Schrock (kathy@kathyschrock.net) 19

Specify the entire URL to go to
<A HREF=“http://cnn.com/”>Go to CNN</A>

n

n

c1999 Kathleen Schrock (kathy@kathyschrock.net)

20

Changing the link color
n

n

n n

If you change the background color, you may need to change the link color, too <BODY BGCOLOR=“#00FFFF” text=“#000000” link=“#FF0000” VLINK=“#000000”> Link is the color before choosing Vlink is the color of the visited link
c1999 Kathleen Schrock (kathy@kathyschrock.net) 21

Part 4: Adding Graphics

c1999 Kathleen Schrock (kathy@kathyschrock.net)

22

Graphics for your page
n n n n

Adding graphics to your page
n

Adding graphics to your page Aligning graphics Using graphics as links Insert a background package

Two file formats
– GIF for icons and line drawings – JPEG for photographs

n n n n

Try to keep graphic files under 30k Example of adding an apple picture <IMG SRC=“apple.gif” alt=“apple”> The alt tag shows up in text browsers
c1999 Kathleen Schrock (kathy@kathyschrock.net) 24

c1999 Kathleen Schrock (kathy@kathyschrock.net)

23

4

Aligning graphics on a page
n

n

n

By default, the next line of text starts after the graphic image By using the align tag, the text can be next to the graphic <IMG SRC=“apple.gif” alt=“apple” ALIGN=RIGHT>

By using the align=right tag, you can move the picture to the right side of the text and put the text next to the picture rather than below it.

c1999 Kathleen Schrock (kathy@kathyschrock.net)

25

Using graphics as links
n

Inserting a background picture
n

You may use a picture as a hypertext link by typing <A HREF= “http://apple.com/”><IMG SRC= “apple.gif” alt=“apple”></A> which results in an apple picture with a blue box around it to show it as a link; for no box, add BORDER=0 to the IMG SRC tag
c1999 Kathleen Schrock (kathy@kathyschrock.net) 27

Background pictures should be small gifs that tile well
<BODY BACKGROUND=“background.gif” text=“#000000” link=“#FF0000” VLINK=“#000000”>

n

c1999 Kathleen Schrock (kathy@kathyschrock.net)

28

Parts of a table
<TABLE> <TR> <TD> </TD> </TR> <TR> <TD> </TD> </TR> </TABLE>
29 c1999 Kathleen Schrock (kathy@kathyschrock.net) 30

Part 5 : Tables

c1999 Kathleen Schrock (kathy@kathyschrock.net)

5

Adding a border
n n n n

Changing the size of a table
n

Becomes an attribute of the TABLE tag <TABLE BORDER=2> Gives your table a 2 pixel border With a border=0, you can easily create columns that are lined up and leave as much space as you wish

n

n n

By default, tables take up as much room as they need to hold the text To make it a certain size, add the attribute to the TABLE tag <TABLE height=100 width=200> You can also use these in the <TD> tag to change the size of a particular cell
c1999 Kathleen Schrock (kathy@kathyschrock.net) 32

c1999 Kathleen Schrock (kathy@kathyschrock.net)

31

Adding a caption
n

Cell padding and spacing
n n

n n n

Used to tell someone what the table means Comes after the TABLE tag <CAPTION></CAPTION> Appears at the top of the table

n

n
c1999 Kathleen Schrock (kathy@kathyschrock.net) 33

Attributes of the TABLE tag Cell spacing adds space between the cells without making the cells bigger Cell padding adds space around the contents of a cell, pushing the walls of the cell outward <TABLE cellspacing=2 cellpadding=2>
c1999 Kathleen Schrock (kathy@kathyschrock.net) 34

Table Headings
Used to put column headings in the table <TR> <TH></TH><TH></TH> </TR>
n

Spanning across columns or cells
n

<TD colspan=2> would have data cover two columns

n

<TD rowspan=2> would have data cover two rows

c1999 Kathleen Schrock (kathy@kathyschrock.net)

35

c1999 Kathleen Schrock (kathy@kathyschrock.net)

36

6

The End

c1999 Kathleen Schrock (kathy@kathyschrock.net)

37

7