Notes for using (X)HTML anchors (<a> elements)
The number one instrument for linking to other pages and files is the anchor (<a>) element.
Anchors are inline elements.
By default, browsers usually display anchor elements underlined and in a color other than black. You may notice that this color varies depending on whether the anchor has been visited (ie. it links to a resource that your browser has already loaded) or whether the mouse is clicking on the anchor.
A few rules and tips when using headers...
- Every anchor should have an "href" attribute. (On older pages you may find anchors that do not have "href" attributes and, instead, have "name" attributes. This method of using anchors has been deprecated.) This "href" attribute should specify the url of the resource to which the anchor links. "href" values may be absolute url's, relative url's or mailto links...
- Absolute url's begin with "http://" (or "https://") and are used mainly to link to pages or files on other websites.
- Relative url's don't have the "http://" or "https://" prefixes and are used mainly to link to pages or files on the same website.
- Mailto links begin with "mailto:" and are followed with a valid email address. Clicking the anchor will indicate to the browser that the user wishes to send an email to that email address.
- An anchor may have a "target" attribute, which will indicate to the browser where the clicked page or file will open. Using "_blank" for the value of the "target" attribute, for example, tells the browser to open a new window and display the result of the click there.