The text between the opening tag and the closing tag is either the start or destination (or both) of a link. Attributes of the anchor tag are as follows.
OPTIONAL. If the HREF attribute is present, the anchor is sensitive text: the start of a link. If the reader selects this text, (s)he should be presented with another document whose network address is defined by the value of the HREF attribute . The format of the network address is specified elsewhere . This allows for the form HREF="#identifier" to refer to another anchor in the same document. If the anchor is in another document, the attribute is a relative name , relative to the documents address (or specified base address if any).
OPTIONAL. If present, the attribute NAME allows the anchor to be the destination of a link. The value of the attribute is an identifier for the anchor. Identifiers are arbitrary strings but must be unique within the HTML document. Another document can then make a reference explicitly to this anchor by putting the identifier after the address, separated by a hash sign .
OPTIONAL. An attribute REL may give the relationship (s) described by the hypertext link. The value is a comma-separated list of relationship values. Values and their semantics will be registered by the HTML registration authority . The default relationship if none other is given is void. REL should not be present unless HREF is present.
OPTIONAL. The same as REL , but the semantics of the link type are in the reverse direction. A link from A to B with REL="X" expresses the same relationship as a link from B to A with REV="X". An anchor may have both REL and REV attributes.
OPTIONAL. If present, this specifies a uniform resource number for the document.
OPTIONAL. This is informational only. If present the value of this field should equal the value of the TITLE of the document whose address is given by the HREF attribute.
OPTIONAL. The value of this field is a string which if present must be a comma separated list of HTTP METHODS supported by the object for public use.
All attributes are optional, although one of NAME and HREF is necessary for the anchor to be useful.
You can specify a target window or frame for a hyperlink. This is where the linked page will open. If no target is specified, the link will open in the same window/frame. The format is this (where the target is "self"):
Go To Page 1
The target window options are:
- _self : Opens in the same window and same frame.
- _top : Opens in the same window, taking the full window if there is more than one frame.
- _parent : Opens in the parent frame.
- _blank : Opens in a new window.
If you have a frameset defined, you can set your target as any particular frame. For example, if you have a navigation frame called"nav" and a main frame called "main", set the target of your navigation links like so:
Go To Page 1
Go To Page 2
Note: Instead of specifying a target for each individual link, you can define a "base target" for an entire frame or page. This means that every link on the page will use the base target by default. Place the base target tag in the page's head. Example: