HTML Links

Learn how to create hyperlinks to navigate between pages and websites

Introduction to HTML Links

The <a> tag defines a hyperlink, which is used to link from one page to another.

Basic Link Example:

        
<a href="https://www.codingrider.com">Visit Coding Rider</a>
        
    

Output:

This will render as:

Visit Coding Rider

Types of Links

External Link (to another website):

        
<a href="https://www.codingrider.com">Visit Coding Rider</a>
        
    

Output:

This will render as:

Visit Coding Rider

Linking to Other Pages

You can link to other pages within your website using relative URLs.

                            
<a href="about.php">About Us</a>

Output:

This will render as:

About Us

Linking to Sections within a Page

You can link to specific sections of a page using anchors.

        
<a href="#section1">Go to Section 1</a>
        
    

Output:

This will render as:

Go to Section 1

Linking to Email Addresses

You can create links that open the user's email client.

                            
<a href="mailto:support@codingrider.com">Email Us</a>

Output:

This will render as:

Email Us

Link Attributes:

  • href - Specifies the URL of the page the link goes to
  • target - Specifies where to open the linked document (e.g., _blank for new tab)
  • title - Specifies extra information about the link
                            
<a href="https://www.codingrider.com" target="_blank" title="Example Website">Visit Coding Rider</a>

Output:

This will render as:

Visit Coding Rider

Linking to Other Pages

You can link to other pages within your website using relative URLs.