Web Development and Design Foundations with XHTML, 5th Edition

(Steven Felgate) #1
A.9 Text-Level Elements^589

<a href="mypage.html" title="My Page">My Page</a>
This creates a relative link to the named file, in this case mypage.html. It will also dis-
play the text associated with the titleattribute in a tooltip alongside the link when
the visitor places the mouse pointer on the link.
<a href="mailto:[email protected]">Send e-mail to [email protected]</a>
This creates a link to an e-mail address. If a default mail program is configured for the
browser, the mail program will launch and get ready to send a message with the e-mail
address provided, in this case [email protected].
<a href="#top">Back to Top</a>
This creates an internal link to a bookmark or named fragment on the same Web page,
in this case to the named fragment called top.
<a id="top"></a>
This identifies a portion of a Web page as a bookmark or named fragment, in this case,
the named fragment called top.
<a target="_parent" href="mypage.html">My Page</a>
This configures the window that the hyperlinked page will display in. The target
attribute is most often used with frames. Table A.12 lists <a>tag attributes and their
values. Values for the targetattribute are shown in Table A.13.

Table A.12tag attributes


Attribute Value Usage
accesskey A character on the keyboard that
appears in the hyperlink description

Configures a hot key to activate the link without using the
mouse pointer.
href A valid URL or Web page file name Creates a link to the named page or named element.
id Text name, alphanumeric, beginning
with a letter, no spaces

Uniquely identifies the element. This value can be used by
a corresponding hyperlink.
name Text name, alphanumeric, beginning
with a letter, no spaces

Identifies the element. This value is used by a correspon-
ding <a>tag with an hrefattribute. This is deprecated in
XHTML but is included for backward compatibility.
tabindex Numeric Changes the order of the links accessed by pressing the
tkey. Default order is the order the links are placed on
the page.
target See Table A.13 Configures the window that displays the link. The default is
the current window. See Table A.13.
title A brief text description Configures a brief text description that will display in some
browsers when a mouse pointer is placed over the link.
← Previous
Free download pdf