<A>
tag
with an HREF
attribute specifying the destination. Here all you need for the
destination is the file name.
<A HREF="anotherpage.html">Here is another page</A>
HREF
attribute. If linking to another site, you
must use the entire URL, including the "http://" part, or the link may not work. For example,
if you want to link to Lamont's Cel Gallery, which has the URL www.twinplanets.com/cels/index.html,
you would use this code:<A HREF="http://www.twinplanets.com/cels/index.html">Go to Lamont's Cel Gallery!</A>
NOTE: If a URL does not end with an actual filename, the server will look for a file
called index.html in the location given. For example, if you have a link to
www.twinplanets.com/music/ the
server will actually look for www.twinplanets.com/music/index.html .
In cases like this, it's a good idea to
include the slash at the end of the URL, so that the server knows that the filename isn't present in
the URL. If in doubt, the best way to determine the correct URL for a site is to actually go there and
copy the URL from the address bar of your browser.
|
<A HREF="policies/summary.html">Summary of policies</A>
../
<A HREF="../index.html">Main home page</A>
../
for each subdirectory level you're jumping up through.
www.twinplanets.com
and you want to link to the page
www.twinplanets.com/cels/gallery_misc.html
you would use the code:<A HREF="/cels/gallery_misc.html">Miscellaneous animation cels</A>
<A>
and </A>
tags.
You can also place an <IMG>
tag there instead, in which case the graphic you've
inserted becomes a hot link in its own right. This is how live buttons, etc. are inserted into Web
pages.
<BODY>
and </BODY>
tags
and insert the text you
copied to the clipboard by pressing <CTRL><V>. Add a title between the <TITLE>
and </TITLE>
tags that reads: Links of all kinds
. Save your file under
any name you choose (but be sure that you give it an .html
extension), load it into your browser, and
view it.
<BR>
tags after each
paragraph, to get rid of that "run-on" look. Next, let's add a few links.
Locate the words "Twinplanets Home Page" at the
end of the first paragraph, and let's make it into a link:
<A HREF="http://www.twinplanets.com/twinplanets.html">
</A>
<A HREF="http://www.ala.org/">
http://
in the actual link even if you
don't show it to the user; otherwise the link will not work.
</A>
http://
from the
HREF
attribute and see if the link still works.
<IMG SRC="star3.gif" ALIGN="LEFT">
ALIGN="LEFT"
attribute, this causes the text to "wrap around" the graphic as well as keeping it to the
left. Try leaving out this atttribute and see what happens).
<IMG>
tag, add the
tag <A HREF="http://www.nasa.gov/">
<IMG>
tag, add the ending tag </A>
BORDER="0"
to the <IMG>
tag, so that it
now looks like this:<IMG SRC="star3.gif" ALIGN="LEFT" BORDER="0">
BORDER
attribute specifies how
thick (in pixels) the border should be. The default is one pixel, so if that's what you want
just leave it out.
<A>
and </A>
tags. For example, at the end of the next paragraph of text (ending with the words "it will
work, like this:") add this code:<BR><BR>
<A HREF="http://www.nasa.gov/"><IMG SRC="star4.gif" BORDER="0">
<BR>Welcome to NASA</A>
Terms to know from this lesson |
Absolute addressing: Specifying the entire URL of a link. |
Relative addressing: Specifying a link destination in terms of its relative position to the page with your link. |
BORDER attribute: Sets the width of a border in pixels. |
![]() | ![]() | ![]() | ![]() | ![]() |
![]() | ![]() | ![]() | ![]() | |