Top Banner
Creating a Web Creating a Web portal: Part II portal: Part II HyperText Markup Language (HTML) Bair-Mundy
75

Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Dec 28, 2015

Download

Documents

Moris Lamb
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: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Creating a Web portal: Creating a Web portal: Part IIPart II

HyperText Markup Language (HTML)

Bair-Mundy

Page 2: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Surfing the 'Net

Client

Server

Webserver application responds to requests from clientBrowser application

sends requests to server

Page 3: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

A word about HTML

HyperText Mark-up Language

Page 4: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

ManuscriptChapter One

A Mysterious Visitor It was a dark and stormy night. As was my custom on a Friday night, I was curled up in my favorite armchair reading Cataloging & Classification. All of a sudden, I heard a loud “Tap, tap, tap” on the window. Wondering what type of person would be out and about on such a stormy night, I went over, pulled aside the curtain, and peered out into the darkness.

Page 5: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Marked-up manuscriptChapter One

A Mysterious Visitor It was a dark and stormy night. As was my custom on a Friday night, I was curled up in my favorite armchair reading Cataloging & Classification. All of a sudden, I heard a loud “Tap, tap, tap” on the window. Wondering what type of person would be out and about on such a stormy night, I went over, pulled aside the curtain, and peered out into the darkness.

B

A

fleur

graphic

b.f.

ital.

Page 6: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Paste-up

Chapter OneA Mysterious Visitor

It was a dark and stormy night. As was my custom on a Friday night, I was curled up in my favorite armchair reading Cataloging & Classification. All of a sudden, I heard a loud “Tap, tap, tap” on the window.

Wondering what type of person would be out and about on such a stormy night, I went over, pulled aside the curtain, and peered out into the darkness.

Page 7: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

ASCII (text) fileChapter One

A Mysterious VisitorIt was a dark and stormy night. As was my custom on a Friday night, I was curled up in my favorite armchair reading Cataloging & Classification. All of a sudden, I heard a loud “Tap, tap, tap” on the window.

Wondering what type of person would be out and about on such a stormy night, I went over, pulled aside the curtain, and peered out into the darkness.

Page 8: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

HTML file<HTML><CENTER><H1>Chapter One</H1><H2>A Mysterious Visitor</H2><IMG SRC=“fleur.gif”></CENTER><P>It was a dark and stormy night. As was my custom on a Friday night, I was curled up in my favorite armchair reading <I>Cataloging & Classification</I>. All of a sudden, I heard a loud <B>“Tap, tap, tap”</B> on the window.</P><P>Wondering what type of person would be out and about on such a stormy night, I went over, pulled aside the curtain, and peered out into the darkness.</P></HTML>

HTML tags (instructions to the browser)

Page 9: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Web page

Chapter OneA Mysterious Visitor

It was a dark and stormy night. As was my custom on a Friday night, I was curled up in my favorite armchair reading Cataloging & Classification. All of a sudden, I heard a loud “Tap, tap, tap” on the window.

Wondering what type of person would be out and about on such a stormy night, I went over, pulled aside the curtain, and peered out into the darkness.

Page 10: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Coding a Web page• Create an ASCII file with

textual content

• Use HTML tags to format text and indicate where to place graphics

• Place file on Web server

• Open directory & file to public

Page 11: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Paired tags

<I> . . . </I>

The most important thing to remember is to <I>remain calm</I>. This is the first lesson to be learned. If you start to …

The most important thing to remember is to remain calm. This is the first lesson to be learned. If you start to …

HTML Displays as

The most important thing to remember is to <I>remain calm. This is the first lesson to be learned. If you start to …

The most important thing to remember is to remain calm. This is the first lesson to be learned. If you start to …

<TABLE> . . . </TABLE>

Page 12: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Single tags

Hello.My name is Kimo.

Hello. My name is Kimo.

<BR>

<HR>

HTML Displays as

Hello. <BR>My name is Kimo.

Hello. My name is Kimo.

Hello. <HR>My name is Kimo.

Hello.

My name is Kimo.

Page 13: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

HTML tags

<HTML>

</HTML>

Page 14: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Two parts of a Web page<HTML>

<HEAD>

</HEAD>

<BODY>

</BODY></HTML>

Page 15: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Head of a Web page

<HEAD>

<TITLE> donna’s LIS 670 test file page </TITLE>

</HEAD>

Page 16: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Title tags

Page 17: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Head of a Web page

<HEAD>

<TITLE> donna’s LIS 670 test file page </TITLE>

<meta name="DC.subject" lang="eng " content="Information science technology" />

</HEAD>

Page 18: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Meta tags – Dublin Core

http://dublincore.org/

Page 19: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Meta tags – Dublin Core

http://dublincore.org/

Title

Subject

Description

Type (e.g., image)

Creator

Publisher

Page 20: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Body of a Web page

<BODY>

Material that will appear in the viewing window of the browser.

</BODY>

Page 21: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Adding a header

<BODY>

<H1>My Web Portal</H1>

Aloha, World!</BODY>

Page 22: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Level 1 header

Page 23: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Header levels<BODY>

<H1>My Web Portal</H1>

<H2>This is a level 2 header</H2>

Aloha, World!</BODY>

Page 24: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Header levels (cont'd)

Page 25: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Horizontally centering an item

<BODY>

<CENTER><H1>My Web Portal</H1>

</CENTER>

</BODY>

Not:<H1><CENTER>My Web Portal</H1></CENTER>

Page 26: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Centering an item (cont'd)

Page 27: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

To a Web page in the same directory as the source file

Adding a hot link

<A HREF=“my_other_file.html”>

Click here to go to my other file.

</A>Clickable

text

Linkdestination

Page 28: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

To a Web page in a different location from the source file

Adding a hot link

<A HREF=“http://www.ala.org/ala/aboutala/offices/oif/index.cfm”>

Click here to go to the ALA Office of Intellectual Freedom Website.

</A>

Full URL of Link

destination

Page 29: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Using an image as a hot link

<A HREF=“http://www.ala.org”>

<IMG SRC=“http://www2.hawaii.edu/~donnab/lis670/ala.jpg”>

</A>

IMG tells the browser to place

image hereSRC (source) tells the browser where to find the image

URL of image in quotes

Page 30: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Creating paragraphs

<HTML> In our word processor we can just hit the Enter key a couple of times and we get a new paragraph.

However, that does not work in HTML. Let’s see what this would look like if viewed in a browser.

</HTML>

If we type this:

Page 31: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Creating paragraphs

In our word processor we can just hit the Enter key a couple of times and we get a new paragraph. However, that does not work in HTML. Let’s see what this would look like if viewed in a browser.

We get this:

Page 32: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Creating paragraphs

<HTML> In our word processor we can just hit the Enter key a couple of times and we get a new paragraph.

However, that does not work in HTML. Let’s see what this would look like if viewed in a browser.

</HTML>

<P>

</P><P>

</P>

Page 33: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Creating paragraphs

In our word processor we can just hit the Enter key a couple of times and we get a new paragraph.

However, that does not work in HTML. Let’s see what this would look like if viewed in a browser.

Page 34: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Creating a table

<TR>

</TR>

<TABLE>

</TABLE>

<TD>Neat stuff

</TD>

<TD>More neat stuff

</TD>

Page 35: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Creating a table (cont'd)

Page 36: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Adding a table border

<TABLE BORDER=3><TR>

<TD>Neat stuff

</TD>

<TD>More neat stuff

</TD></TR></TABLE>

Page 37: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Adding a table border (cont'd)

Page 38: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Widening a table

<TABLE WIDTH=100% BORDER=3><TR>

<TD>Neat stuff

</TD>

<TD>More neat stuff

</TD></TR></TABLE>

Page 39: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Widening a table (cont'd)

Page 40: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Adding a row to the table<TABLE WIDTH=100% BORDER=3><TR>

<TD>Neat stuff

</TD>

<TD>More neat stuff

</TD></TR><TR>

<TD>Stupendous stuff

</TD>

<TD>Supercalifragilisticexpialidocious

</TD></TR></TABLE>

Page 41: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Added row

Page 42: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Adding color to the table<TABLE WIDTH=100% BORDER=3 BGCOLOR=PINK><TR>

<TD >Neat stuff

</TD>

<TD>More neat stuff

</TD></TR><TR>

<TD>Stupendous stuff

</TD>

<TD>Supercalifragilisticexpialidocious

</TD></TR></TABLE>

Page 43: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Added color

Page 44: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Adding color to specific cells<TABLE WIDTH=100% BORDER=3><TR>

<TD bgcolor=pink>Neat stuff

</TD>

<TD>More neat stuff

</TD></TR><TR>

<TD>Stupendous stuff

</TD>

<TD bgcolor=pink>Supercalifragilisticexpialidocious

</TD></TR></TABLE>

Page 45: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Added color

Page 46: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Making table legible with colored rows<TABLE WIDTH=100% BORDER=3>

<TR bgcolor=pink><TD>Color</TD><TD>makes</TD><TD>row</TD>

<TD>legible</TD></TR>

<TR> <TD>No color</TD> <TD>gives</TD> <TD>row</TD> <TD>contrast</TD></TR>

<TR bgcolor=pink><TD>Color</TD><TD>makes</TD><TD>row</TD>

<TD>legible</TD>

</TR>...</TABLE>

pink added

no pink added

pink added

Page 47: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Increased table legibility

Page 48: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Adding a style sheet<HEAD> <TITLE> donna’s Web portal </TITLE>

<style type="text/css">

</style>

</HEAD>

cascading style sheet

Page 49: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Adding a style sheet<HEAD> <TITLE> donna’s Web portal </TITLE>

<style type="text/css"> h1 { color : green ; }

h2 { color : blue ; } </style>

</HEAD>

Page 50: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Style-sheet rule

Selector Declaration block

h2 { color : blue ; }

Property Value

Page 51: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Without a style sheet<html><head><title>Basic HTML document with paragraphs</title></head><body>

<h1>Cascading Style Sheets</h1><h2>Introduction</h2><p>Cascading Style Sheets (CSS) are used to format the way things appear on a Web page. When using Cascading Style Sheets HTML is used to provide structure and the style sheet is used to control how the elements look on the page. </p>

<h2>The Term</h2><p>The term "Style sheet" refers to a list of rules for formatting various elements.The word "Cascading" refers to the fact that you can have multiple style sheets which follow rules of precedence. </p></body></html>

Page 52: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Without a style sheet

Page 53: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

With a style sheet<html><head><title>Basic HTML document with paragraphs</title>

<style type="text/css">h2 { color : blue ; }</style></head><body><h1>Cascading Style Sheets</h1><h2>Introduction</h2><p>Cascading Style Sheets (CSS) are used to format the way things appear on a Web page. When using Cascading Style Sheets HTML is used to provide structure and the style sheet is used to control how the elements look on the page. </p><h2>The Term</h2><p>The term "Style sheet" refers to a list of rules for formatting various elements.The word "Cascading" refers to the fact that you can have multiple style sheets which follow rules of precedence. </p></body></html>

Page 54: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

With a style sheet

Page 55: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Add a little color to our header<html><head><title>Basic HTML document with paragraphs</title>

<style type="text/css">h2 { color : blue ; background-color : pink ; }</style></head><body><h1>Cascading Style Sheets</h1><h2>Introduction</h2><p>Cascading Style Sheets (CSS) are used to format the way things appear on a Web page. When using Cascading Style Sheets HTML is used to provide structure and the style sheet is used to control how the elements look on the page. </p><h2>The Term</h2><p>The term "Style sheet" refers to a list of rules for formatting various elements.The word "Cascading" refers to the fact that you can have multiple style sheets which follow rules of precedence. </p></body></html>

Page 56: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Adding background color using our style sheet

Page 57: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Adding a style sheet<HEAD> <TITLE> donna’s Web portal </TITLE>

<style type="text/css"> body { background : #FFC0FF ; } h1 { color : green ; }

h2 { color : blue ; } </style>

</HEAD>

Page 58: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Color coding in hexadecimal numbers

#FFC0FF

Red

Green

Blue

R G

B

Page 59: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Binary numbers

0 0 7100 10 1

1 1 14 2 1

Base Ten 0 1 2 3 4 5 6 7 8 9 10

Base Two 0 1 10 11 100 101 110 111 1000 1001 1010

Page 60: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Hexadecimal numbers

2 5 5100 10 1

F F256 16 1

Base Ten 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Base 16 0 1 2 3 4 5 6 7 8 9 A B C D E F 10

0 01 123456789ABCDEF

Counting…

16 1

Decimal number

Hexadecimal number0

Page 61: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Coding black in hexadecimal numbers

#000000

00 00 00

Page 62: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Coding red in hexadecimal numbers

#FF0000

00 00 00FF

Page 63: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Coding green in hexadecimal numbers

#00FF00

00 0000 FF

Page 64: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Coding blue in hexadecimal numbers

#0000FF

00 0000 FF

Page 65: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Coding white in hexadecimal numbers

#FFFFFF

00 0000 FFFF FF

Page 66: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Coding turquoise in hexadecimal numbers

#00FFFF00 0000 FFFF

Page 67: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Coding fuchsia in hexadecimal numbers

#FF00FF

00 0000 FFFF

Page 68: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Coding lilac in hexadecimal numbers

#FFC0FF00 0000 FFFF C0

C0

12 x 16 = 192

Page 69: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Hexadecimal codes for colors

http://www.december.com/html/spec/color.html

Web search on: hexadecimal codes web page

http://www.w3schools.com/html/html_colors.asp

Page 70: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

The <div> tag<html><head><title>Basic HTML document with paragraphs</title>

<style type="text/css">h2 { color : blue ; }div { background-color : #FFDDFF}</style></head><body><h1>Cascading Style Sheets</h1>

<div><h2>Introduction</h2><p>Cascading Style Sheets (CSS) are used to format the way things appear on a Web page. When using Cascading Style Sheets HTML is used to provide structure and the style sheet is used to control how the elements look on the page. </p>

</div><div><h2>The Term</h2><p>The term "Style sheet" refers to a list of rules for formatting various elements.The word "Cascading" refers to the fact that you can have multiple style sheets which follow rules of precedence. </p>

</div></body></html>

Page 71: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Formatting with the div tag

Page 72: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Linking your pages (1)

<A HREF=“second_page.html”>Click here to go to next page.</A>

first_page.html

<A HREF=“first_page.html”>Click here to return to previous page.</A>

second_page.html

Page 73: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Alt attribute

<IMG SRC="flower.gif" ALT="picture of a flower">

Gives text alternative for image to aid lynx users or viewers with vision problems

<IMG SRC=“smiley_face.gif" ALT="picture of smiling face">

<IMG SRC=“frowney_face.gif" ALT="picture of frowning face">

Page 74: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

Table data for screen readers

<TABLE><TR><TD>Neat stuff <BR></TD></TR></TABLE>

Breaktag

Page 75: Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.

End of Part II