HTML a Tag

HTML a Tag

Use the HTML5 <a> tag, to add a hyperlink to an HTML Document. You need to add the href attribute, under the <a> element, to link a web page to another.

Example

The following example shows how to work with HTML <a> tag,

Here’s the output,

Attributes

The following are the attributes of the <a> tag,

  • charset
    To set the character-set if the document to be linked. Deprecated Attribute.
    Value: char_encoding
  • cords
    Set the coordinates here. Deprecated Attribute.
    Value: coordinates
  • download
    The target gets downloaded on clicking the hyperlink. This is an HTML5 Attribute.
    Value: filename
  • href
    The URL of the page the link goes to
    Value: URL
  • hreflang
    The language of the linked document.
    Value: language_code
  • media
    Set the media query here for device. This is an HTML5 Attribute.
    Value: media_query
  • name
    The name of the anchor. Deprecated Attribute.
    Value: section_name
  • rel
    It is the relationship between the current and linked document. Deprecated Attribute.
    Value: alternate, author, bookmark, external, help, license, next, nofollow, noreferrer, noopener, prev, search, tag
  • rev
    It is the relationship between the linked and linked document. Deprecated Attribute.
    Value: text
  • shape
    To set the shape of the link. Deprecated Attribute.
    Value: default, rect, circle, poly
  • target
    To set where the linked document will open.
    Value: _blank _parent _self _top framename
  • type
    Set the media type of the linked document.
    Value: media_type

HTML <!DOCTYPE> Declaration
HTML5 abbr Tag
Studyopedia Editorial Staff
Studyopedia Editorial Staff
[email protected]

We work to create free tutorials for all.

No Comments

Post A Comment