HTML `a` tag

Explore the basics of using HTMLaMark to create link

The link is to usealabel. The link target is set through its settinghrefAttributes.


<a href="">click here</a>

Between the start tag and the end tag, we have the link text.

The example above is an absolute URL. Links can also use relative URLs:

<a href="/test">click here</a>

In this case, after clicking the link, the user will move to/testThe URL of the current source.

Be careful/Features. If omitted, the browser will addtestThe string of the current URL.

For example, I’m on the page have these links:

  • /testOnce clicked, it takes me to
  • testOnce clicked, it takes me to

Link tags can contain other content, not just text. For example, the image:

<a href="">
	<img src="test.jpg">

Or any other element, in addition to other<a>label.

If you want to open the link in a new tab, you can usetargetAttributes:

<a href="" target="_blank">open in new tab</a>

Download mine for freeHTML manual

More HTML tutorials: