Example

Some more examples of href

<base href="https://www.freecodecamp.org/a-href/">This gives a base url for all further urls on the page</a>
<link href="style.css">This is a live link to an external stylesheet</a>

What else can you do with <a href>?

More customization! Let's see a specific use case:

A mailto link is a kind of hyperlink (<a href=""></a>) with special parameters that lets you specify additional recipients, a subject line, and/or a body text.

The basic syntax with a recipient is:

<a href="mailto:friend@something.com">Some text</a>

Adding a subject to that mail:

If you want to add a specific subject to that mail, be careful to add %20 or + everywhere there’s a space in the subject line. An easy way to ensure that it is properly formatted is to use a URL Decoder / Encoder.

Adding body text:

Similarly, you can add a specific message in the body portion of the email: Again, spaces have to be replaced by %20 or +. After the subject paramater, any additional parameter must be preceded by &

Example: Say you want users to send an email to their friends about their progress at Free Code Camp:

Our mission: to help people learn to code for free. We accomplish this by creating thousands of
videos, articles, and interactive coding lessons - all freely available to the public. We also have
thousands of freeCodeCamp study groups around the world.

Donations to freeCodeCamp go toward our education initiatives, and help pay for servers, services,
and staff.