< Previous | HTML 4.01 Tags / XHTML 1.0 Elements | Next >
Free XHTML 1.0 Class | HTML Validators | Free HTML 4.01 Class
Creates anchors (either hyperlinks or text references) within an XHTML document.
- AvantGo Palm OS
- AvantGo Windows CE
- Firefox 1, 2
- Internet Explorer 2, 3, 4, 5, 6, 7
- Mozilla 1
- Netscape 2, 3, 4, 6, 7, 8
- Opera 3, 4, 5, 6, 7, 8, 9
- Safari 1, 2
- WebTV/MSN TV
- HTML 3.2, 4.0
- XHTML 1.0: Client-Side Image Map Module, Hypertext Module, Intrinsic Events Module, Name Identification Module, Target Module
All attributes are optional unless indicated.
CDATA Any text that you want linked. The following tags are valid within the <a> tag:
acronym, applet, b, basefont, bdo, big, br, button, cite, code, dfn, em, font, i, iframe, img, input, kbd, label, map, object, q, s, samp, script, select, small, span, strike, strong, sub, textarea, tt, u, var
The <a> tag is valid within the following tags:
acronym, address, applet, b, bdo, big, blockquote, body, caption, center, cite, code, dd, del, dfn, div, dt, em, fieldset, font, form, h1, h2, h3, h4, h5, h6, i, iframe, ins, kbd, label, legend, li, noframes, noscript, object, p, pre, q, s, samp, small, span, strike, strong, sub, sup, td, th, u, var
- link to a frame called "main"
<a href="/od/frames" target="main">frame link</a>
View - link in a series of pages
<a href="/od/htmltags/p/bltags_abbr.htm" rel="Next" rev="Prev">Next</a>
View - link with an access key
<a href="/od/accessibility/" accesskey="a">access key is a</a>
View
<a> Special Notes
- All of the attributes of the <a></a> tag are optional. The values for the element may then be set at a later time using dynamic scripts.
- Keep the <a></a> tags as the innermost tag in a nest of tags. This isn't required, but it makes the code cleaner and easier to script.
- If you set a target on a link and you're not in a frameset, that link will open in a new window with the name of that target.
- Links with access keys will open when that access key is pressed in conjunction with the alt or command key on the keyboard. This makes pages more accessible.
- Do not nest multiple <a></a> tags, this is not allowed.
- When creating image links, make sure that the closing </a> tag is flush with the final > of the image tag. Otherwise, some browsers display the additional whitespace as a small underscore beside the image.
More <a> Information
- Adding Links
- How to Write Internal Links
- Creating Better Links
- How to Open a Link in a New Window
- Mail Links
- How to Remove the Underlines From Links
Return to XHTML Element (HTML Tags) Library
< Previous | HTML 4.01 Tags / XHTML 1.0 Elements | Next >
Free XHTML 1.0 Class | HTML Validators | Free HTML 4.01 Class

