HTML - Text Links

Examples

To help you understand how to create and style text links in HTML, here are some sample code snippets and live examples that show different types of text links and their behavior.

Example: Basic text link

<a href="https://www.example.com">Click here to visit Example.com</a>

Example: Text link with a title attribute

<a href="https://www.example.com" title="Visit Example.com">Example Website</a>

Example: Text link that opens in a new tab

<a href="https://www.example.com" target="_blank">Open Example.com in a new tab</a>

Example: Text link to an email address

<a href="mailto:info@example.com">Send an email to info@example.com</a>

Example: Text link to a specific section on the same page

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

...

<h2 id="section1">Section 1</h2>