HTML and CSS Reference
The URL itself is bad.
Sometimes URLs become invalid. Because a URL is a form of absolute path-
name, if the file to which it refers moves around, or if a machine or directory
name gets changed, the URL won't be valid anymore. Try contacting the per-
son or site you got the URL from in the first place. See whether that person
has a more recent link.
Be sure to read the error message provided by the browser carefully. Often it
will describe the reason why the link can't be opened, indicating whether it is
a network problem or a problem with the URL.
QCan I put any URL in alink?
A You bet. If you can get to a URL using your browser, you can put that URL in a
link. Note, however, that some browsers support URLs that others don't. For exam-
ple, Lynx is good with mailto URLs (URLs that enable you to send electronic mail
to a person's email address). When you select a mailto URL in Lynx, it prompts
you for a subject and the body of the message. When you're done, it sends the
QCan I use images as links?
A Yup, in more ways than one, actually. You learn how to use images as links and
define multiple links within one image using image maps in Lesson 9, “Adding
Images, Color, and Backgrounds.”
Q My links aren't pointing to my anchors. When I follow a link, I'm always
dropped at thetop of the page rather than at theanchor. What's going on
A Are you specifying the anchor name in the link after the hash sign the same way
that it appears in the anchor itself, with all the uppercase and lowercase letters
identical? Anchors are case-sensitive, so if your browser can't find an anchor name
with an exact match, the browser might try to select something else in the page
that's closer. This is dependent on browser behavior, of course, but if your links
and anchors aren't working, the problem usually is that your anchor names and
your anchors don't match. Also, remember that anchor names don't contain hash
signs—only the links to them do.
QIsthere any way to indicate a subject in a mailto URL?
A If you include ?subject=Your%20subject in the mailto URL, it will work with
most email clients. Here's what the whole link looks like:
< a href=”mailto:firstname.lastname@example.org?subject=Your%20subject” >Send email< /a >
Search WWH ::