Also called the anchor tag, identifies a link or a location within a document. You commonly use this tag to create a hyperlink, using the HREF= attribute. You can also use the <A> tag to identify sections within a document, using the NAME= attribute.

Eaxample:

<A HREF="http://www.cs-tutorial.com/">Visit CS Tutorial Website</a>

Attribute of <A> Tag

  1. ACCESSKEY
  2. CHARSET
  3. CLASS
  4. COORDS
  5. HREF
  6. ID
  7. NAME
  8. REL
  9. REV
  10. SHAPE
  11. STYLE
  12. TABINDEX
  13. TARGET
  14. TITLE
  1. ACCESSKEYAssigns a key sequence to the element.

    Example

    <A HREF="help.html" ACCESSKEY="H"> HELP</a>
    Posible Values
    Any Character.
  2. CHARSETSpecifies character encoding of the data designated by the link. Use the name of a character set defined in RFC2045. The default value for this attribute, appropriate for all Western languages, is "ISO-8859-1".

    Example

    <A HREF="help.html" CHARSET="ISO-8859-1"> HELP</a>
    Posible Values
    UTF-8 - Character encoding for Unicode ISO-8859-1 - Character encoding for the Latin alphabet
  3. CLASSIndicates the style class to apply to the <A> element.

    Example

    <A HREF="next.html" CLASS="casual"> Next</A>
    Posible Values
    Any class name that are created
  4. COORDSIdentifies the coordinates that define a clickable area. Measure coordinates, in pixels, from the top left corner of the image.

    Example

    <A SHAPE="RECT" COORDS="20,8,46,30" HREF="food.html">
    Posible Values
    Any Integer number.
  5. HREFSpecifies the relative or absolute location of a file to which you want to provide a hyperlink.

    Example

    <A HREF="details.html">More Info</a>
    Posible Values
    Any page name with extension or URL
  6. IDAssigns a unique ID selector to an instance of the <A> tag. When you then assign a style to that ID selector, it affects only that one instance of the <A> tag.

    Example

    <A HREF="next.html" ID="123">Next</A>
    Posible Values
    Any ID that you define.
  7. NAMEMarks a location within the current document with a name. The browser can then quickly move to specific information within a document. You can link to existing named locations in a document by using a fragment URL, consisting of a pound sign (#) and the name (from within that document), or by using a more complete URL, including a pound sign and a name (from other documents or sites).

    Example

    <A HREF="#ingredients">Ingredients</A><BR> <A NAME="ingredients"><h1>Ingredients</H1>
    Posible Values
    Any Unique Name for page to identify the location.
  8. RELSpecifies relationship hyperlinks.

    Example

    <A REV="made" HREF="mailto:bob@company.com">
    Posible Values
    Any URL.
  9. REVSpecifies reverse relationship hyperlinks.

    Example

    <A REV="Previous" HREF="http://www.cs-tutorial.com/quiz.html">
    Posible Values
    Any name.
  10. SHAPESpecifies the type of shape used to represent the clickable area. SHAPE=RECT indicates that the shape is rectangular. SHAPE=CIRCLE specifies that the shape is a circle. SHAPE=POLY indicates that the shape is a polygon represented by three or more points.

    Example

    <A SHAPE="RECT" COORDS="20,8,46,30" HREF="food.html">
    Posible Values
    RECT
    CIRCLE
    POLY
  11. STYLESpecifies Style Sheet commands that apply to the contents within the <A> tags.

    Example

    <A STYLE="background: red" HREF="page2.html">Page 2</A>
    Posible Values
    Any one or more CSS properties.
  12. TABINDEXIndicates where the element appears in the tabbing order of the document.

    Example

    <A HREF="food.html" TABINDEX="4">Food</A>
    Posible Values
    Any Integer Number.
  13. TARGETIndicates the name of a specific frame into which you load the linked document. You establish frame names within the <FRAME> tag. The value of this attribute can be any single word.

    Example

    <A HREF="application2.html" TARGET="pages">Go to Page 2</a>
    Posible Values
    _blank
    _parent
    _self
    _top
    framename
  14. TITLESpecifies text assigned to the tag that you can use for context-sensitive help within the document. Browsers may use this to show tool tips over the hyperlink.

    Example

    <A HREF="page2.html" TITLE="Go to the next page">
    Posible Values
    Any text message