back to home

HTML Links

  1. HTML links are hyperlinks. You can click on a link and jump to another document.
    When you move the mouse over a link, the mouse arrow will turn into a little hand.
    A link does not have to be text. It can be an image or any other HTML element. Example:
    < a href="https://www.w3schools.com">< img src="img/HTML Structure.png" alt="example" width="400">< /a>

    Click on the picture:
    example
  2. As well as, you can use the "button" tag to link address. Example,
    < a href="https://www.w3schools.com">< button>Press me< /button>< /a>
  3. HTML links are defined with the < a > tag
  4. The link's destination is specified in the href attribute.
  5. < a href="https://www.w3schools.com" >This is a link< /a >
  6. The link's destination is specified in the href attribute.
  7. The target attribute specifies where to open the linked document.
    The target attribute can have one of the following values:

    _blank ~ Opens the linked document in a new window or tab.
    If you set the target attribute to "_blank", the link will open in a new browser window or tab.
    < a href="https://www.w3schools.com/html/" target="_blank">< /a> Click for example

    _self ~ Opens the linked document in the same window/tab as it was clicked (this is default).
    < a href="https://www.w3schools.com/html/" target="_self">< /a> Click for example

    _parent ~ Opens the linked document in the parent frame.
    < a href="https://www.w3schools.com/html/" target="_parent">< /a> Click for example

    _top ~ Opens the linked document in the full body of the window
    < a href="https://www.w3schools.com/html/" target="_top">< /a> Click for example

    framename ~ Opens the linked document in a named frame.
    < a href="https://www.w3schools.com/html/" target="framename">< /a> Click for example