Sat. Feb 4th, 2023
  • A webpage can contain various links/hyperlinks that take you directly to other pages and even specific parts of a given page
  • Hyperlinks allow visitors to navigate between Web sites by clicking on words, phrases, and images.

AnchorĀ <a>

  • A link is specified using HTML tag <a>, also is called anchor tag
  • The HTML <a> (anchor element) creates a hyperlink to other web pages, files, locations within the same page, email addresses, or any other URL.
  • The href attribute is the most important attribute which specifies links to destination page or URL href="url path"
  • target attribute Specifies where to display the linked URL. target="_blank"
  • title attribute makes the anchor links more accessible, semantic, meanigful, title="Click to visit"
  • rel attribute describes relationship of current linked object and target object, rel="next/downnload/help/author"

Syntax & Example:

<a href="url-path" title="accessible" target="_blank" rel="next/prev/help/download">Content</a>

Syntax & Example:

<a href="" title="Click to visit Google">Visit</a>

internal external links

Syntax & Example:

<a href="./"title="visit links" >Links example 1</a> <br/> <br/>

<a href="../Working with Table/08.01.table.basic.html"title="Click to visit Table" >Table example 1</a> <br/>

download links

  • Ability to download some file or resource

Syntax & Example:

<a href="help.pdf" title="download help pdf" download>Download Help PDF</a>

replace the name of the file while downloading

<a href="_help123.pdf" title="download help pdf" download="html_help">text</a>

in this scenario, "_help123.pdf" will be renamed with "html_help.pdf"

fragment identifiers / anchor #links

  • #Anchors helps to jump to a specific section of current (within)/other linked URL/file
  • Need to Define and linked to the ID of the specific element

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *