Barbara Sommer
basommer@ucdavis.eduNOTE This tutorial is new and subject to improvement. Please send me your comments and suggestions (see e-mail address above). Click here to find out who else helped on this project. B. Sommer 1/12/99
For a decent, quick and easy webpage, it is hard to beat Composer in Netscape, or the HTML features in Microsoft Word. But if you want to be able to make changes and know how things work, then this is the tutorial for you. You will learn the nuts-and-bolts basics that will allow you to create a web page. HTML is very easy.
If you start to feel overloaded, just skim and return later to particular sections on a need-to-know basis. Then when you are ready to move on, check the resource list at the end or search the web for more advanced tutorials.
You will be creating files and moving them to folders/directories. A file is a single document or image. A folder (Macintosh) or directory (PC) is the larger container in which you place files. I will be using folder and directory interchangeably.
Note: I will use Courier font for file and folder/directory names, as well as for code that you will need to type.
b) PC Windows click the right mouse button to see the menu.
When you see the picture, select "Save this image as" and then select the visuals folder that you created and save the image to it. Do that for each of the following 5 images. Use the BACK button on your browser to return here.
| PART 1 (15 pp) 1. Create a Webpage 2. Adding Headings 3. Inserting Breaks 4. Style 5. Lists |
PART 2 (15 pp) 6. Visuals 7. In-house Links 8. Internet Links 9. A Touch-up 10. Link with Images 11. Niceties 12. Organizing Files |
PART 3 (9 pp) 13. Links to Sections of a Page 14. Tables 15. Tag List & Resources |
HTML (HyperText Markup Language) is a code that uses tags enclosed in < > to instruct the computer to display text or images or to perform operations such as linking to other pages or sites. It is also used to format text. For example, the HTML code for the heading fo this section is
The "/" slash character indicates "end." Most of the tags require an ending tag containing / thereby telling the browser to stop tagging the text.
You may use upper or lower case (i.e., <h3> or <H3> gives the same result).
If you make a mistake in HTML you will not bomb or crash; your web page just won't look right. It is easy to correct the code.
Ready? Let's get started. (Reminder: You need a web browser and text editor installed on your computer -- see Intro section for specific information.)
An HTML document contains two distinct parts, the head and the body. The head contains information that is not displayed on the screen. The body contains everything that is displayed on the web page. The basic structure of an HTML page is:
Enclose all HTML work within <html>...</html> tags. To begin:
<body> Welcome to Social Science 78, the Psychology of Domestic Cats.
</body>
</html>
NOTE: The <title>. . . . </title> tags are located. within the <head> . . . . </head> portion and will not be visible on the screen. You will see it at the very top in the title bar of your web page. (Later we will add a title that will appear on the page itself.)
The information within <title>. . . . </title> is used by search engines such as WebCrawler or Yahoo for their keyword searches. .
If you are using a Word editor instead of SimpleText or NotePad, be sure to save as a text document. The browsers will not read Word documents.
Windows 3.1 users only -- use .htm instead of .html, e.g., SS78.htm
NETSCAPE - File menu, select Open and then Open Page .
EXPLORER - File menu, select Open and then Browse to see files on your local disk.
A cat is a carnivourous mammal (Felis catus) long domesticated and kept by humans as a pet or for catching rats and mice.
Note that this text should be above the </body> and </html> tags at the bottom of your HTML file.
Return to the browser where the previous version of your file was displayed. To see the changes, click the RELOAD button in the browser. If there is a mistake, return to your text file, correct it, and SAVE it. Then return to the browser, and RELOAD to view the corrected version.
Do not use SAVE when you are in the browser (Netscape or Explorer).
Experiment with your window arrangements, positioning them so that you can easily switch back and forth between your text editor (SimpleText or NotePad) and your browser (Netscape or Explorer) windows.
Headings can be created in 6 sizes:
The format for an HTML heading tag is:
<hN>Text to Appear in Heading</hN>
where N is a number from 1 to 6 identifying the heading size -- level 1 (largest) down to to level 6 (smallest).
<h1>SS78 Psychology of Domestic Cats</h1>
Note: Use the RETURN to add spaces to make your text file easier to read. The spacing will not show up in the browser version.
<h2>Introduction</h2>
<h2>Course information</h2>
<h2>Feline behavior</h2>
<h3>Social relationships</h3>
<h3>Birthing</h3>
<h2>Visual portrayal</h2>
Your web page should look something like this.
A cat is a carnivourous mammal (Felis catus) long domesticated and kept by humans as a pet or for catching rats and mice.
If your page doesn't look right, check your HTML code in your text editor. It should look like this.
<body>
Welcome to Social Science 78, the Psychology of Domestic Cats
<h1>SS78 Psychology of Domestic Cats</h1>
A cat is a carnivourous mammal (Felis catus) long domesticated and kept by humans as a pet or for catching rats and mice.
<h2>Introduction</h2>
<h2>Course information</h2>
<h2>Feline behavior</h2>
<h3>Social relationships</h3>
<h3>Birthing</h3>
<h2>Visual portrayal</h2>
</body>
</html>
Don't worry about blank spaces in your code. They won't show up on the web page.
<h1>SS78 Psychology of Domestic Cats<h1> [missing "/"]
<center> . . . . </center>
<h1>SS78 Psychology of Domestic Cats</h1>
to
<center><h1>SS78 Psychology of Domestic Cats</h1></center>
Note: The principle for tag order is to embed or nest each set within another set.
<h1><center> . . . </center></h1> produces the same result.
You have created and modified an HTML document and should feel comfortable with the process of editing text and reloading it into your web browser. This easy lesson is on inserting breaks in the text.
A web browser ignores all of the CARRIAGE RETURNS typed into your text editor. You need to add these by using HTML tags. For example, the HTML code for forcing a paragraph break is <p>. Wherever a browser sees the paragraph tag, it inserts a blank line.
This tag is special in that it does not require an ending tag; you do not need to use </p>
Also, the header <h > tags have a built in break so it is unnecessary to put <p> tag before a header tag, such as
To insert a paragraph break
It appears to be of Egyptian or Eastern origin.
This section should now look like
<h2>Introduction</h2> A cat is a carnivorous mammal (Felis catus) long domesticated and kept by humans as a pet or for catching rats and mice.
<p>It appears to be of Egyptian or Eastern origin.
In order to separate the opening sentence of the page from the other portions that follow,
Welcome to Social Science 78, the Psychology of Domestic Cats.
<hr>
And finally, there is the <br> tag which forces text to a new line like the <p> tag, but without inserting a blank line. You might use this tag when making a list of items, when writing the lines of a poem, etc. Compare the differences between using the <p> and <br> in these two examples:
Result
One Hell of a nice animal, frequently mistaken for a meatloaf.
B. Kliban, author
Result
B. Kliban,
author
HTML offers several tags for adding style to your text. Don't overdo it -- too many changes clutter the text and make it difficult to read.
HTML
Result
<b>This is Bold... </b>
This is Bold...
<i>This is Italic... </i>
This is Italic...
You can combine the style tags as long as they are correctly nested; one set within the other.
<i><b>This Bold AND Italic</b></i>
This is Bold AND Italic
<b><i>And So is This </i></b>
And So is This
<b>cat</b>
A <b>cat</b> is a carnivourous mammal <i>(Felis catus)</i> long domesticated and kept by humans as a pet or for catching rats and mice.
Listed items may be preceded by bullets (Unordered) or numbers (Ordered), or neither. Lists are easy to format in HTML and can be nested (lists of lists) to build an outline .. Lists are also handy for creating an index or table of contents to a series of documents or chapters.
Unordered Lists, or ul tags, are ones that appear as a list of items with bullets or markers in the front.
<ul>
<li>Schedule
<li>Reading list
<li>Past exams
</ul>
Ordered lists are ones where the browser numbers each successive list item starting with "1." Note that the only difference is changing the <ul> tag to <ol>.
There are many sources in which to study humans' perceptions of the cat's appearance and behavior. These include:
<ol>
<li>Painting
<li>Photography
<li>Cinema
<li>Cartoons
</ol>
<p>For more information, consult the course reading list.
Another option is to use the <ul> or <ol>tag, omitting the <li> tags, using <br> or <p> between items.
Layout note: An easy way to indent a chunk of text is to surround it with
<ul>. . .</ul>, omitting the <li> tags.
You can embed any of the above list types within another list type, for example
Here is the HTML for producing this format (indented to make it easier to read). We won't do it now, but it is here for future reference. Don't forget the ending tags, (e.g., </ol>,</ul>, etc.).
<li>Item #2 of 2nd set
<li>#3 of 2nd set
</ul>
<li>Item #3 of 1st set
</ol>
You get the idea. Take a rest, and then move on to section#6 VISUALS (the best part)
CHECK ... Your web page should look something like this....CHECK
A cat is a carnivourous mammal (Felis catus) long domesticated and kept by humans as a pet or for catching rats and mice.
It appears to be of Egyptian or Eastern origin.
There are many sources in which to study humans' perceptions of the cat's appearance and behavior. These include:
For more information, consult the course reading list.
Here is the HTML code.
<html>
<head>
<title>SS78</title>
</head>
<body>
Welcome to Social Science 78, the Psychology of Domestic Cats
<hr>
<center><h1>SS78 Psychology of Domestic Cats</h1></center>
<h2>Introduction</h2>
A <b>cat</b> is a carnivourous mammal <i>(Felis catus)</i> long domesticated and kept by humans as a pet or for catching rats and mice.
<p>It appears to be of Egyptian or Eastern origin.
<h2>Course information</h2>
<ul>
<li>Schedule
<li>Reading list
<li>Past exams
</ul>
<h2>Feline behavior</h2>
<h3>Social relationships</h3>
<h3>Birthing</h3>
<h2>Visual portrayal</h2>
There are many sources in which to study humans' perceptions of the cat's appearance and behavior. These include:
<ol>
<li>Painting
<li>Photography
<li>Cinema
<li>Cartoons
</ol> For more information, consult the course reading list.
</body>
</html>
If your code looks good, you are ready for Part 2.