×
   ❮     
HTML CSS MySql Javascript SQL PYTHON JAVA C++ C# BOOTSTRAP REACT XML NODEJS ANGULAR DJango Rust Android VUE
     ❯   

HTML Link


What is Links in HTML?

Links allow users to click their way from page to page.

Note: A link does not have to be text. A link can be an image or any other HTML element!


HTML Links Syntax:

Let's see the syntax how you can create link in html.

Example

<a href="url">link text</a>
Try it Yourself »

Let's see Example:

Example

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Visit Learn Fasta</title>
  <style>
    body {
      font-family: 'Arial', sans-serif;
      text-align: center;
      margin-top: 50px;
      font-size: 18px;
    }
    a {
      text-decoration: none;
      color: #3498db; /* Blue color for the link */
      font-weight: bold;
    }
    a:hover {
      text-decoration: underline;
    }
  </style>
</head>

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

</html>
Try it Yourself »

Target Links

target attribute specifies where to open the linked document.

In your attribute(a href="url" target="_blank") you can add target="_blank"


Target Links syntax:

Example

<a href="url" target="_blank">link text</a>
Try it Yourself »

Link to an Email Address

Use mailto: inside the href attribute to create a link that opens the user's email program


Link to an Email Address syntax:

Example

<a href="mailto:someone@example.com">link text</a>
Try it Yourself »

Let's see Example:

Example

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Visit Learn Fasta</title>
  <style>
    body {
      font-family: 'Arial', sans-serif;
      text-align: center;
      margin-top: 50px;
      font-size: 18px;
    }
    a {
      text-decoration: none;
      color: #3498db; /* Blue color for the link */
      font-weight: bold;
    }
    a:hover {
      text-decoration: underline;
    }
  </style>
</head>

<body>
  <a href="mailto:example@gmail.com">Learn Fasta</a>
</body>

</html>
Try it Yourself »

Hey there! Let's go for Learn fasta then! It is more than just coding; it is to have the superpower that can solve any problem. Through simple and easy-to-grasp examples you will sail through the learning process. In addition, it is not just about coding– you will acquire competencies on how to solve complex problems, analyze data, and come up with efficient solutions. Shall we start this wonderful journey together! learnfasta.com terms of use, Copyright 2025 All Rights Reserved.