Kanbritech Learn logo
HTML HTML Tutorial 45h track

HTML Links

Write a link to an about.html page and a separate link to your contact section.

Understand the topic

An anchor with href navigates to a URL, a file, or a location within a page. Use descriptive link text so the destination makes sense outside its surrounding sentence. Relative URLs point within your project; absolute URLs include the destination scheme and host. mailto links request an email application rather than sending a message automatically.

Worked example

<p><a href="https://example.com">Visit the example website</a></p>
<p><a href="#contact">Contact details below</a></p>
<section id="contact"><h2>Contact</h2><a href="mailto:hello@example.com">Email the team</a></section>

The fragment #contact matches a unique id. Browser and email application settings determine how the mailto link opens.

Practice

Write a link to an about.html page and a separate link to your contact section.

Show a suggested answer
<a href="about.html">About our team</a>
<a href="#contact">Contact the team</a>

Common mistake

Avoid links labelled only "click here". Use a button for an action that changes the current interface rather than pretending every action is navigation.

HTML documentation

Live Example

Try Coding

Result