CREATING SIMPLE WEB PAGES
ADDING LINKS TO YOUR WEB PAGES
After finishing yesterday’s
lesson, you now have a couple of pages that have some headings, text, and lists
in them. These page are all well and
good, but rather boring. The real fun starts when you learn how to create
hypertext links and link your pages to the web.
IN THIS LESSON
Today, you’ll learn just that. Specifically,
you’ll learn about the following:
§
All about the HTML link tag <a> and its
various parts
§
How to link to other pages on your local disk by
using relative and absolute pathnames
§
How to link to other pages on the web by using
URLs
§
How to use links and anchors to link to specific
places inside pages
§
All about RULs: the various parts of the URL and
the kinds of URLs you can use.
CREATING LINKS
The create a link in HTML, you
need two things:
The name of the file (or the URL
of the file) to which you want to link
§
The text that will serve as the clickable link.
Only the text included within the link tag is actually
visible on your of page. When your readers click on the link, the browser loads
the URL associated with the link.
The create a link in
an HTML page, you use the HTML link tag <a>…</a>. the <a> tag
often is called an anchor because it also can be used to create anchors
for links. (you’ll learn more about creating anchors later today.) the most
common use of the link tag, however, is to create links to other pages.
Unlike the simple tags you learned about in the preceding
lesson, the <a> has some extra features: the opening tag, <a>,
includes both the name of the tag <a> and extra information about the
link itself. The extra features are called attributes of the tag. (you first
discovered attributes in lesson 4, “learning the basics of HTML,” when you
learned about lists.) so, rather than the opening <a> tag having just a
name inside brackets, it looks something like the following:
<a name=”up” href=”menu.html” title=”the twelve
caesars”>
The extra attributes ( in this example, name, href, and title) describe the link itself,
the attribute you’ll probably use most often is the href attribute, which is
short for hypertext reference. You use the href attribute to specify the name
or URL of the file to which this link points.
Like most HTML tags, the link tag also has a closing tag,
</a>. all the text between the opening and closing tags will become the
actual link on the screen and be highlighted, underlined, or colored blue or
red when the web page is displayed. That’s the text you or your readers will
click to follow the link to the URL in the href attribute.
Figure 5.1 shows the parts of a typical link using the
<a> tag, including the href, the text of the link, and the closing tag.
No comments:
Post a Comment