|
Linking to other web pages
One of the major features of HTML is the ability to "link" to other web pages. You can link to other pages within your own site or pages on other sites. It's also possible to link to a specific section within a web page. A text link on a web page is commonly recognized as a section of colored, underlined text. (This is not always the case, as some web designers use other visual cues to represent web links.)
Anchor Tag:
Linking to another web page (text link)
- <A HREF=url>linked text</A>
- Example: <A HREF="http://www.fandm.edu">Franklin and Marshall College</A>
Linking to another web page (graphic link)
- <A HREF=url><graphic tag></A>
- Example: <A HREF="http://www.fandm.edu"><IMG SRC="button.gif"></A>
Linking within a web page (anchor link)
Step 1: Add a named anchor within a section of a web page
- <A NAME=text>
- Example: <A NAME="example">
Step 2: Link to the named anchor
- <A HREF=#text>linked text</A>
- Example: <A HREF="#example">Go to Example</A>
Example: <A HREF="http://www.fandm.edu/home.html#example">Go to Example</A>
- Linking to e-mail (e-mail link)
- <A HREF=mailto:email>linked text</A>
- Example: <A HREF="mailto:bfrankli@fandm.edu">Ben
Franklin</A>
-
NOTE:
It's posible to modify your page contents with more than one tag. This is referred to as "nesting tags." The graphic link example above is a nested tag. For example, you may want to add italic formatting to a word inside a header. There are two things to keep in mind here. First, not all tags can contain all other kinds of tags. As a general rule, those tags that affect entire paragraphs (block-level tags) can contain tags that affect individual words or letters ( inline ), but not vice versa. Second, order is everything. Whenever you use a closing tag it should correspond to the last unclosed opening tag. In other words, first A then B, then /B, and then /A.
|