You have seen how to link to other web pages, whether they are ones you created or have found elsewhere on the Internet. You can also make connections within a single document, or to specific locations in other documents.
If your file is long, it might be useful to be able to skip to a different section of the same page. Or to a marked section of another page. This can be accomplished in two steps by using named anchors, which are hidden reference marks.
To show how this works, on your course page we will place a table of contents right under the Welcome greeting. A couple of these will be linked with anchors placed elsewhere. First, we will embed named anchors for each of the main heading sections on your course page. Then we will create the table of contents.
Don't forget the closing </a> tag. You have now marked the line that contains the header Introduction with a hidden reference marker, the named anchor intro. It won't look any different in the browser.
Let's do one more.
Now we will set up the table of contents that will appear near the top of the screen. We will use an unordered list to create this list (see Module #5 for more on lists).
to
to
There is no </a> because you are not specifying an image or line of text as the target.
Check the result in the web browser. It is a useful device.
You can create links that jump to a sections of any HTML document that is marked by named anchors. For example, you may have large file with one subsection that you would like to use for one course, and another subsection appropriate for a second course.
where filename is the name of the target HTML file and #NAME is the term in the named anchor that is placed within that file.
<a href="http//psychology.ucdavis.edu/sommerb/#bottom">End of B. Sommer's page</a>
I haven't done that, but you get the idea. Don't forget the # marker.
Tables are very useful for formatting text and images on a page. Once you are on to them, they provide great layout flexibility. Here are the HTML tags in table form.
| <table> | begins the table | </table> | ends the table |
| <tr> | starts a row tr=table row |
</tr> | ends a row |
| <td> | begins a cell td=table data |
</td> | ends it |
The text or image is inserted between the <td> tags which are embedded within <tr>...</tr>. The following HTML would create a table of 2 rows of 3 cells each.
Let's try one.
<html>
<head>
<title>Class schedule</title>
</head>
<body>
<h2>Class schedule</h2>
<table width=50% border=3>
<tr>
<td>Date</td><td>Topic</td><td>Reading</td>
</tr>
<tr>
<td>Mon. 1/6</td><td>Introduction</td><td>Ch. 1</td>
<tr>
<tr>
<td>Wed. 1/8</td><td>Physical development</td><td>Ch. 2</td>
<tr>
</table>
</body>
</html>
You can change the width of the table display by changing the %.
You can increase or decrease the border size, by increasing or decreasing the number. Using <table> alone results in the default width and eliminates the border.
HURRAY! You made it through. Please let me know. My e-mail address is basommer@ucdavis.edu (Barbara Sommer). And include suggestions, criticism, or questions, as you wish.
The next (and last) section provides a tag list and some references.
This is not a comprehensive list of HTML tags. It is a start. To learn about others, see the reference list at the end of these pages.
OUTER TAGS
| <html> . . . </html> | Defines limit of document |
HTML document has 2 sections: HEAD and BODY within above.
| <head> . . . </head> | Outside of main page |
| <title> . . .</title> | Within HEAD tags; shows in top window bar in browser. |
| <body> . . .</body> | Contains web page document. |
HEADERS
| <h1> . . .</h1> | Most prominent header |
| <h2> . . . </h2> | . |
| <h3> . . . </h3> | . |
| <h4> . . . </h4> | . |
| <h5> . . . </h5> | . |
| <h6> . . . </h6> | Least prominent header |
CENTERING
TEXT BREAKS
| <p> | Paragraph |
| <br> | Line break |
| <hr> | Horizontal rule/separator |
STYLES
| <b> . . .</b> | Boldface |
| <i> . . .</i> | Italics |
UNORDERED LIST - list with bullets
| <ul> | |
| <li> | First item in the list |
| <li> | Next item in the list |
| </ul> |
ORDERED LIST - numbered list (1, 2, 3, etc.)
| <ol> | |
| <li> | First item in the list |
| <li> | Next item in the list |
| </ol> |
LIST - neither bullets nor numbers
or use
<dl>
<dd>
First item in the list
<dd>
Next item in the list
</dl>
IMAGES
align=top/middle/bottom.
alt="text alternative to image"
LINKS
To graphic files
To another resource
Within a document
| Target anchor tag (invisible) | <a name="anchorname">target text line or image</a> |
| Link to target anchor (will be underlined) | <a href="#anchorname">linking text or image</a> |
To bring up e-mail form
| <a href="mailto:your_e-mail_address">Your Name and/or e-mail address</a> |
FONT COMMANDS
| <font size=X> | Changes font size, X=1-7 (largest) |
| <font face=fontname> | Changes font face |
| <font color=colorname> | Changes font color |
| </font> | Ends font command, returning to previous condition |
TABLES
|
|
table |
|
|
row |
|
|
cell |
MISCELLANEOUS
| <!-- text --> | Place a comment within the HTML source code. |
| <body bgcolor=colorname> | Changes background color (note incorporation into <body> tag). |
Once you get on to HTML coding, a handy tag reference is
For more information on graphic design, check out the following Internet sites.
http://www.projectcool.com/ Project Cool: Anyone can build a great website!
###