27
Prostate Cancer Screening in African American Men Mark H. Kawachi, MD FACS Director, Prostate Cancer Center City of Hope, National Medical Ctr

Essentials of HTML Class 4 Instructor: Jeanne Hart [email protected]

Embed Size (px)

Citation preview

Page 1: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Essentials of HTMLClass 4

Instructor: Jeanne Hart

[email protected]

Page 2: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Creating Lists

In this lesson, you will learn to use HTML to organize your text into lists.

Page 3: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Lesson 6 – Creating Lists

Types of ListsOne way to organize the text in your Web pages

is with lists.

Page 4: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Lists con’t

In addition to the obvious benefit of being able to list items on a page, they also provide a design benefit by enabling you to break up long pages of ordinary paragraphs. HTML recognizes the following list types and has tags that correspond to each:

Page 5: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Lists con’t

Bulleted (unordered) listsNumbered/lettered (ordered) listsDefinition lists

Page 6: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Tip

You should use ordered lists when the items in the list must be followed in a specific order, and use unordered lists when they do not.

You generally use definition lists for terms and their definitions, but they can have other uses as well.

Page 7: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Bulleted List

A bullet (usually a solid circle) appears in front of each item in an unordered list.

HTML automatically creates the bullet when you use the unordered list tag (<ul>) together with the list item tag (<li>).

Page 8: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Lists con’t

Although the following sample HTML shows each list item as a single line of text, your list items can be as long as you want:

Page 9: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Bulleted Lists con’t

<ul><li>first item in the list</li><li>second item in the list</li><li>third item in the list</li></ul>

Page 10: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Formatting Bulleted Lists

HTML automatically adds a solid circle in front of each list item as a bullet, but you have two other choices.

Using style sheet tags you can select one of two other bullet types: a square or a hollow circle.

You can see how your HTML document would look if you chose to use a square bullet instead of the standard solid circle.

Page 11: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Lists Con’t<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0

Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head><title>Bullet Options</title>head> <body> <ul class="square"> <li>a list item</li><li>another list item</li></ul><ul

class="image"><li>a list item</li><li>another list item</li> </ul> </body> </html>

Page 12: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Very Important!

What is going to happen if you don’t close the ul tag?

Page 13: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Numbered Lists

If the items in your list should follow a specific order, as in recipes or instructions, you want to use the ordered list tag (<ol>). With this tag, HTML automatically numbers or letters your items for you. Here's an example:<ol><li>first item in the list</li><li>second item in the list</li><li>third item in the list</li></ol>

Page 14: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Lists con’t

Did you notice how similar the two list samples are?

Both the <ul> and <ol> tags call for the individual list items to be identified with the <li> tag.

Like the <ul> tag, HTML has an automatic style for the list items within the <ol> tag. HTML automatically numbers the items with the familiar Arabic numerals (1, 2, 3, and so on). What's more, it automatically renumbers the list items if you decide to add or delete items later.

Page 15: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Definition Lists

If you need it, HTML has one more type of list available to you: the definition list, which uses the <dl> tag. Rather than using the usual <li> tag to specify the items in the list, this type of list uses the <dt> tag (for definition terms) and the <dd> tag for their definitions. Following is an example of the HTML for a definition list.

<dl><dt>The Definition Term</dt><dd>Is defined below the term.</dd></dl>

Page 16: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Summary

In this lesson, you've learned:HTML recognizes three different list types:

unordered (bulleted), ordered (numbered), and definition.

Rather than the default bullet style (a solid circle), style sheets enable you to select three other bullet types: a square, a hollow circle, or an image of your own.

Page 17: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Creating Tables

In this lesson, you will learn how to build tables using HTML, and how to control the layout and appearance of a Web page using tables.

Page 18: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Simple TablesTraditionally, tables have been used for

displaying tabular data (such as numbers) in rows and columns. The flexibility of HTML, however, enables Web developers to create tables that display more than just numbers.

Page 19: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Caution

Although HTML tables look similar to your favorite spreadsheet, HTML tables don't perform mathematical functions.

Page 20: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Tables con’t

HTML tables are not difficult to create, but they do require some organization. All HTML tables begin with the opening <table> tag and end with the closing </table> tag. In between those tags are three other tags to be aware of, as follows:

Page 21: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Tables con’t

<tr> defines a horizontal row.<td> defines a data cell within that row.<th> specifies a data cell as a table

heading. In newer browsers, a table heading cell is formatted as centered and bold.

Page 22: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Tip

The World Wide Web Consortium's Web site (www.w3.org/TR/REC-html40/struct/tables.html) has detailed descriptions of all the attributes available for tables, as well as examples of how you can use them.

Page 23: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Advanced TablesHTML contains two more attributes that you

should be aware of when formatting tables. The colspan (which causes a cell to span two or more columns) and rowspan (which causes a cell to span two or more rows) attributes are invaluable when creating complex tables.

Since this is an Essentials of HTML class I won’t be going over these two advanced tags.

Page 24: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

TipEven if you don't plan to place a border

around the cells in your table, it's much easier to see how your HTML commands are interpreted by your Web browser when you have the borders turned on (<table border="1">).

Page 25: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Style Sheets

HTML was never meant to control the form or appearance of Web pages. It's a language that defines the structure and function of elements on a page. It lets the Web browser decide how those elements should actually appear.

Page 26: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

What can Style sheets do for me?

1. You can separate form and structure.

2. You can make smaller, faster pages.

3. You can maintain or update many pages

Page 27: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

1. You can Separate Form from Structure

HTML was never meant to control the form or appearance of Web pages.

It's a language that defines the structure and function of elements on a page.

It lets the Web browser decide how those elements should actually appear.

Page 28: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

2. You can make smaller, faster pages

Stylesheets are simple text, just like HTML.

With CSS, you can do things that you previously had to resort to spacer GIFs for.

Cascading stylesheets mean fewer table tags and other HTML tags cluttering up your code.

Page 29: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

3. You can maintain or update many pages faster and easier.

Without stylesheets, if we wanted to update the font used for body text across my entire site, we'd have to manually edit each page.

The whole point of stylesheets is to separate form and structure.

Page 30: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Three Types of Style Sheets

In-line: styles for specific tags on a page e.g., change a paragraph to bluee.g., change h1 tag to 18 pt. (normally 24pt);

Embedded: rules that apply to a specific page;

External/Linked: set up styles in a separate css page and apply to all pages.

Page 31: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Rules

Style sheets contain one thing: rules. Each rule is a formatting instruction thatapplies to a part of your Web page. A style

sheet can contain a single rule, or it can hold dozens (or even hundreds) of them.

Page 32: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Defining the Rules

Style sheet rules are made up of selectors (the HTML tag that receive the style) and declarations (the style sheet properties and their

values). In the following example, the selector is the body tag and

the declaration is made up of the style property (background) and its value (black).

This example sets the background color for the entire html to black.

body {background:black}

Page 33: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Rules con’t

In a style sheet, the HTML tag is not surrounded by brackets as it would be in the HTML document, and the declaration is surrounded by curly braces.

Declarations can contain more than one property.

Page 34: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Inline Styles

In inline style loses many of the advantages of style sheets by mixing content with presentation. Not only that it is not recommended by the W3C.

The example shows how to change the color and the left margin of a paragraph:

<p style="color:sienna;margin-left:20px">This is a paragraph.</p>

Page 35: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

Embedded Style Sheet

The style properties are includedwithin Embedded Style Sheet An internal style sheet should be used when a single document has

a unique style. You define internal styles in the head section of an HTML page, by using the <style> tag, like this:

<head><style type="text/css">hr {color:sienna;}p {margin-left:20px;}body {background-image:url("images/back40.gif");}</style></head>

the <style> tags) at the top of the HTML document. A style assigned to a particular tag applies to all those tags in this type of document.

Page 36: Essentials of HTML Class 4 Instructor: Jeanne Hart jhartmccc@verizon.net

External/Linked Style Sheet

An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section:

<head><link rel="stylesheet" type="text/css" href="mystyle.css" /></head>

An external style sheet can be written in any text editor. The css file should not contain any html!