html anchor link code example

Example 1: how to make links in html

<a href="link.html"> text link </a> <!-- link to html -->
<a href="google.com" URL> Google </a> <!-- link to site -->
<a href="link.html"><button> Link </button></a> <!-- Button link -->

Example 2: html link tag

<head>
  <link rel="stylesheet" type="text/css" href="theme.css">
</head>

Example 3: link to external site html

<a href="https://www.example.com">This is a link</a>

Example 4: how to add an html anchor

<h2 id="Lorem_Ipsum">Lorem Ipsum</h2> <!--The anchor-->
<a href="#Lorem_Ipsum">top</a> <!--Linking to the anchor-->

Example 5: link to section on page html

<!-- #top is the ID of the div where u wanna link to -->
<a href="#top">Go back to the top!</a>

<div id="top"></div>

Example 6: html a tag

<a href=""></a>

Tags:

Css Example