The anchor element in HTML part1


 Link to external pages with anchor elements:

  • The anchor element a is used to link to the content outside of the web page you are developing or maintaining.
  • While using anchor elements to link to an external page the target attribute must be used the target attribute causes the linked page to open in a new page. 
  • The a element has a destination address assigned to a href attribute.
  • the anchor text is also needed.
  • Here is an example:

  • <a href="webadress" target="blank">anchor text</a>

    • Now your browser will display "this links to the Facebook" as a link that you can click.
    • some examples of using the a element are as under:


  • <a href="www.facebook.com">this links to facebook</a>

    • <a href="www.the-mirs-mechatronics.com">this links to the mirs mechatronics home page</a>


    • <a href="www.alibaba.com">this links to the alibaba</a>

    No comments:

    Post a Comment