What We Will Cover
Elucidations
- What to do when WebCT has problems
- Room Policies
Homework Questions?
Homework Discussion Questions
- Did anyone try a custom install of Firefox?
- Did anyone try to install the Script Debugger for IE?
^ top
2.1: The World Wide Web and HTML
Learner Outcomes
At the end of the lesson the student will be able to:
- Discuss the history of the Web and HTML
- Create elements and attributes
- Discuss the elements of the document head
|
^ top
2.1.1: Introducing the Internet and the World Wide Web
- Networking is about moving data from one computer to another
- Internet: a set of networks connected together with routers
- Routers: special computers that move data between networks
- All computers on the Internet talk to each other using the Internet Protocol (IP)
A Brief History of the Internet
- 1969: Internet started by US DOD with 4 computers -- called ARPANET
- 1983: Internet (1000 computers) split into two parts -- military and university
- 1987: High-speed backbone added to solve performance issues (10K computers)
- 1989: World-Wide Web and HTML invented by Tim Berners-Lee at CERN
- 1992-3: US Government decides to commercialize Internet
- 1993: first graphical browser invented by Marc Andreessen
- While a student at the University of Illinois
- 1998 - E-commerce becomes a "hot" technology
About the World-Wide Web
- Researchers at CERN developed a system of interconnected documents using hypertext
- Documents are stored on computers called servers
- Using the Internet, you can access documents from client computers
- One of the innovations of the web was hypertext
- Hypertext allows users to click items called links to open documents
- Using links allowed users to move around the Internet without needing to know the address of a document
- Documents on the world-wide web are known as web pages
- Each page can contain images, video and sound clips
- All files are stored on web servers
- A web browser is used to view a web page
- You can see an example of how this works in the following image from the textbook

^ top
2.1.2: HTML: The Language of the Web
- A web page is a text file written in Hypertext Markup Language (HTML)
- HTML is a markup language that describes structure and content of a document
- Competing browsers added many extensions to basic HTML, resulting in many incompatibilities
- One way to resolve incompatibilities is to have a set of standards
- The World Wide Web Consortium (W3C) Creates standards for browser manufacturers
- W3C has no enforcement power but recommendations are usually followed
- In 2001, the language of the web started a shift to Extensible HTML (XHTML)
- A reformulation of HTML 4.01 in XML
- Requires a change in coding
- Also, many presentation tags were deprecated
- Future directions of the web are XML and XHTML
Brief History of HTML and XHTML
- HTML 1.0 (1989-1993): included support for inline images and text controls
- HTML 2.0 (1995): supported by all graphical browsers
- HTML 3.0 (1996): proposed replacement for HTML 2.0 was not widely accepted
- HTML 3.2: (1997): added support for tables, more options for form elements and introduced limited programming using scripts
- HTML 4.01 (1999): add support for style sheets and expanded options for tables, forms and scripting
- XHTML 1.0 (2001): reformulation of HTML 4.01 in XML, adding XML rigor to web pages
- XHTML 1.1 (2002): minor update to XHTML 1.0
- XHTML 2.0 (2004): the latest version, designed to remove most of the presentational features left in HTML
^ top
2.1.3: Creating an HTML Document
- HTML documents are composed of various elements
- An element is a distinct feature of an HTML document
- Each element is marked within the HTML file using a tag
Two-sided and One-sided Elements
White Space and HTML
- White space is blank spaces, tabs, and line breaks within the file
- Browsers see no difference between a blank space, a tab, and a line break
Element Attributes
^ top
2.1.4: Structure of an HTML File
- An HTML 4 document is composed of:
- The root element contains all other elements in the document
- Inside the root HTML element are a:
- Head element: containing information about the document
- Body element: containing content to be displayed in the Web page
- You nest the rest of the elements inside either the head or body elements
- You nest elements by placing one inside another
- Proper nesting means you close inner tags before closing outer tags
- The following is simple example showing the structure of an HTML document
HTML Example
1
2
3
4
5
6
7
8
9
10
11
12
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Page title</title>
</head>
<body>
<h1>Heading Size 1</h1>
<p>Some example text content for display</p>
</body>
</html>
|
Viewing the File Locally
- We can view the file locally by copying it into a text editor like TextPad
- Then we save the file to some location on our computer, like the Desktop
- To view the file in a browser, we can usually just double-click it on the Desktop or from an explorer window
- Another way to view the file is by using the File menu of the browser to open the file
^ top
2.1.5: Working with the Document Head
^ top
2.1.6: Summary
Check Yourself
- What is a server? What is a client?
- What is hypertext?
- What is a markup language? What is a markup tag?
- Why was the World Wide Web Consortium created?
- What is a deprecated feature?
- What is XHTML? What is the relationship between HTML and XHTML?
- What is the syntax of a two-sided tag?
- What is the syntax of a one-sided tag?
- What is whitespace?
- How do browsers handler whitespace within an HTML file?
- What is the root element of an HTML file? What two elements are contained in the root element?
- What code would you add to an HTML document to set the page title to "My Grand Party Site"?
^ top
Activity 2.1
Take one minute to read over the following Quick Quiz questions. We will discuss the questions in one minute.
Quick Quiz
^ top
2.2: Working with Block-level Elements
Learner Outcomes
At the end of the lesson the student will be able to:
- Create basic block-level elements
|
^ top
2.2.1: About Block-level Elements
- Within a documents body element, page content is categorized as either block-level or inline
- Block-level elements contain content displayed in a separate section within the page
- Inline elements are placed within block-level elements and are not separated from other page content
- For instance, a paragraph is a block-level element but a link is an inline element
- We will cover some of the most popular block-level elements in this section
^ top
2.2.2: Creating Headings
- Headings are titles placed within the page body
- HTML supports six heading elements, numbered
h1 through h6
- Syntax to mark a heading element, where
x is a number from 1 to 6:
<hx>content</hx>
- For example:
<h1>Heading Size 1</h1>
- Displays the following output
Heading Size 1
^ top
2.2.3: Creating Paragraphs
Some example text content for display
^ top
2.2.4: Creating Lists
- HTML supports three types of list: ordered, unordered and definition
- The following is a brief introduction and some examples
- For more information see your textbook or the HTML specification for lists
Ordered Lists
Unordered Lists
Definition Lists
- Coffee
- Black hot drink
- Milk
- White cold drink
^ top
2.2.5: Generic Blocks and Other Block-level Elements
My generic block
Other Block-level Elements
- HTML supports other block-level elements you may find useful in your Web documents
- See your textbook for more information
- We will cover tables, another block-level element, later in this lesson
- A handy online list is: HTML 4.0 Block-Level Elements
^ top
2.2.6: Summary
- In this section we examined some popular block-level elements and how to use those elements in a Web page
- We looked at the heading element used to place title in the page body
- Syntax to mark a heading element, where
x is a number from 1 to 6:
<hx>content</hx>
- We also looked at the ever-useful paragraph element, which has the syntax:
<p>content</p>
- In addition, we discussed lists and generic blocks
Check Yourself
- What is a block-level element?
- What is an inline element?
- What code would you add to an HTML document create an h1 heading containing the text "My Grand Party Site"?
- What code would you enter to create an ordered list containing the items: Bread, Cheese, and Fruit?
- What code would you use to place the text "My Grand Party Site" in a generic block-level element?
^ top
Activity 2.2
Take one minute to read over the following Quick Quiz questions. We will discuss the questions in one minute.
Quick Quiz
^ top
2.3: Inline Elements and Other Items
Learner Outcomes
At the end of the lesson the student will be able to:
- Create inline elements
- Insert nontextual objects such as inline images into a Web page
|
^ top
2.3.1: About Inline Elements
Why Duplicate Formatting?
- As you try different inline tags, you may notice that many of them format in the same way
- For instance, there are at least four ways to italicize text:
<dfn>, <em>, <i>, <var>
- Why does HTML support so many alternate ways of formatting text?
- The reason is that the main purpose of HTML is not to format text but to structure the content of a document
- Logical elements are created with tags like <cite> and <code>
- These tags describe the nature of enclosed content but not how content should appear
- Physical elements are created with tags like <b> and <i>
- They describe how text should appear and do not indicate nature of element's content
- You should use a logical element whenever that element accurately describes the content it encloses
- You should use physical elements only for general content
^ top
2.3.2: Working with IDs and Classes
^ top
2.3.3: Creating Links
^ top
2.3.4: Working with Images
^ top
2.3.5: Special Characters and Codes
- Sometimes you need to display special characters not available on your keyboard
- HTML supports use of a code number or name
- The following table shows some samples of special characters
- For a more comprehensive list, see:
| Symbol |
Code |
Name |
Description |
| & |
& |
& |
Ampersand |
| < |
< |
< |
Less-than symbol |
| > |
> |
> |
Greater-than symbol |
| |
  |
|
Nonbreaking space, used to insert consecutive spaces |
| © |
© |
© |
Copyright symbol |
^ top
2.3.6: Embedding Media Clips
- You can embed multimedia clips in web pages using the syntax:
<embed src="url" width="value" height="value" autostart="type" />
- Embed element is not part of the official HTML specifications
- Support may be discontinued in the future
- The official specification calls for the
object element
- However, the
object element is not well supported by most browsers
^ top
2.3.7: Summary
- In this section, we looked at inline elements used to structure smaller sections of a document
- In addition, we discussed IDs and Classes
- Syntax to mark an
id attribute:
id="label"
- Syntax to mark a
class attribute:
class="label"
- One of the great features of HTML is the ease of creating links to other documents, using the syntax:
<a href="url">content</a>
- Also, we looked at how to display nontextual objects such as inline images
- Syntax to mark an inline image:
<img src="url" alt="text" />
- Additionally, we looked at how to handle special characters and codes
- Finally, we discussed embedding media clips using the syntax:
<embed src="url" width="value" height="value" autostart="type" />
Check Yourself
- What is a character formatting element and what are some examples of character formatting elements?
- What is a logical element?
- What is a physical element?
- What code would you use to display an inline image containing the image file
party.gif and with the alternate text "My Grand Party Site"
^ top
Activity 2.3
Take one minute to read over the following Quick Quiz questions. We will discuss the questions in one minute.
Quick Quiz
^ top
2.4: Tables, Forms and Frames
Learner Outcomes
At the end of the lesson the student will be able to:
- Create and populate Web tables
- Work with Web forms and their content
- Create Web frames and inline frames
|
^ top
2.4.1: Creating Web Tables
- You can use HTML tables to neatly format data in rows and columns
- You mark a table with the two-sided
<table> tag
- You add rows to your table by nesting the
<tr> tags
- Then you nest
<td> tags to add the table data as cells or columns
- Each row can have one or more table-data tags
- For table headings, you use the
<th> tag instead of <td>
- The following code shows an example table
HTML Code for an Example Table
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
<table border="1" cellspacing="0" cellpadding="5">
<tr>
<th>Heading 1</th>
<th>Heading 2</th>
</tr>
<tr>
<td>row 1, column 1</td>
<td>row 1, column 2</td>
</tr>
<tr>
<td>row 2, column 1</td>
<td>row 2, column 2</td>
</tr>
</table>
|
Display of the Example Table
| Heading 1 |
Heading 2 |
| row 1, column 1 |
row 1, column 2 |
| row 2, column 1 |
row 2, column 2 |
Spanning Rows and Columns
HTML Code for an Example Table with Spanning Cells
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
<table border="1">
<tr>
<th>Heading 1</th>
<th>Heading 2</th>
</tr>
<tr>
<td colspan="2">This cell spans two columns</td>
</tr>
<tr>
<td rowspan="2">This cell spans two rows</td>
<td>row 2, column 2</td>
</tr>
<tr>
<td>row 3, column 2</td>
</tr>
</table>
|
Display of the Example Table with Spanning Cells
| Heading 1 |
Heading 2 |
| This cell spans two columns |
| This cell spans two rows |
row 2, column 2 |
| row 3, column 2 |
Other Table Options
^ top
2.4.2: Creating Web Forms
- An important use of the web is to collect information from people
- This is often done using web forms
- Once the data from a form is collected, it must be sent to the server for processing
- We discuss how to process this server-side processing toward the end of the course
- Elements of a form in which a user can enter information are called control elements
- The following image from the textbook shows a form with several control elements

^ top
2.4.3: Creating a Form Element
^ top
2.4.4: Input Elements
Input Types
^ top
2.4.5: Other Form Elements
- Forms have other ways for users to enter data
- We look at some of those ways in this section
Selection Lists
Text Area Boxes
^ top
2.4.6: Working with Frames
- A frame is a section of the browser window capable of displaying the content of an entire Web page
- A common use of frames is displaying a list of links in one frame while showing individual pages from the site in another
- As an example, this technique is used in WebCT
Creating a Frameset
- Frames are arranged in a frameset
- General syntax:
<html>
<head>
<title>title</title>
</head>
<frameset attributes>
<frame src="frame_a.htm" name="name">
<frame src="frame_b.htm" name="name>
... (more frames possible)
</frameset>
- Where the
frame elements are the documents to display in the frameset
- The syntax for a row or column layout is:
<frameset rows="row1,row2,..."> ... </frameset>
or
<frameset cols="column1,column2,..."> ... </frameset>
- Where
rowX is the height of a frame row and columnX is the width of a frame column
- Row and column sizes can be specified in three ways:
- Number of pixels
- Percentage of total size (%)
- An asterisk (*)
- The asterisk tells the browser to allocate any unclaimed space to the row or column
- For example:
<frameset rows="160,25%,*">
lays out a column 160 pixels wide, followed by another that is 25% of the width and a third that covers whatever space is left over.
- If you use more than one asterisk, the browser will allocate available space evenly between them
- The following diagram shows both a column and row frame layout
- Also, here are links to example frames:
Frame Layouts

Formatting Frames
- By default, a scroll bar is displayed when the content of the source page does not fit within a frame
- Scrolling attribute used to override default setting
- Syntax:
scrolling="type"
Working with Frames and Links
Using the noframes Element
- Some browsers that do not support frames
- Known as frame-blind browsers
- To deal with these browsers, you use the
noframes element
- Marks a section of HTML file for code that frame-blind browsers can use
- A document can contain only one
noframes element
Inline Frames
Problems with Frames
- Frame-based web sites have many problems that have led many designers to avoid using them
- A browser that opens a framed site has to load multiple HTML files before the user can view any of them
- Also, it is difficult to bookmark pages in a frame-based system
- In addition, search engines may not catalog all the pages
- Another issue is that links to external sites may retain the frame
- Still another issues is that it is hard for users to print the entire page
- Finally, some users detest frame-based sites
- Thus, if you want to use frames, you should have both framed and non-frame versions available for users
^ top
2.4.7: Summary
- In this section, we looked at how to create Web tables, forms and frames
Check Yourself
- Refer to page REV 48 of the textbook and review questions #20-33.
^ top
Activity 2.4
Take one minute to review the Check Yourself questions. We will discuss the questions as time permits.
^ top
Wrap Up
Due Next: A2: Applying HTML (9/18/06)
Discussion 1 and Quiz 1 (9/18/06)
^ top
Home
| WebCT
| Announcements
| Schedule
| Room Policies
| Course Info
Help
| FAQ's
| HowTo's
| Links
Last Updated: April 08 2007 @20:05:17
|