CLOSE

Anchor Tag

The <a> tag is used to create hyperlinks to pages on your website or pages anywhere on the internet.

Linking To A Website

<a href="http://www.stepbystephtml.com" target="_blank">Go to SBS HTML</a>
Expand

Creating a Page Anchor

<!DOCTYPE html>
<html>
    <head>
        <title>My Web Page</title>
    </head>
    <body>
        <h1 id="top">My Web Page</h1>
        <p>
            This is my web page. Below this paragraph I'll include a link to the top of my page.
        </p>
        
        <p>
            <a href="#top">Go to Top</a>
        </p>
    </body>
</html>
Expand

Attributes

  • href - URL the link will go to.
  • rel - Relationship between current page and the linked page
    • alternate
    • author
    • bookmark
    • help
    • license
    • next
    • nofollow
    • noreferrer
    • prefetch
    • prev
    • search
    • tag
  • target - The target for the link.
    • _blank - Opens in a blank page
    • _parent - Opens in parent window.
    • _self - Opens in same window.
    • _top - loads the linked document in the topmost frame.

Help Us to Help You

This website and it's tutorials are only made possible with your support. Support money goes towards keeping our servers online.

Amount

Link to Us

Spread the word! Let people know about our tutorials by placing links on blogs, websites, forums and other places.

HTML Link

Copyright 2019 Step By Step HTML. All Rights reserved.