Submodule 2.3: Links
- Link to a web page
- Local link
- Link on an image
Links general
In HTML links are hyperlinks. This means that when you click on a link you go to the destination defined on it.
Commonly, when you move the mouse over a link, the arrow will change to a small hand.
The HTML tag for links is <a>
. <a>
stands for anchor
(attaching something to something else).
Inside the <a>
tag we have the href
attribute. This attribute defines the destination of our link and is not visible on the webpage.
The visible part of our link is the content we place between the <a>
and </a>
tags.
An important attribute of links is the target attribute. Target is placed within the <a> start tag and defines where to open the link. There are lot different values for the target attribute which you can study in w3schools. https://www.w3schools.com/html/html_links.asp
Here we will mention only the _blank value
. A target with this value will open the document in a new window or tab.
<a href="https://yourDestibation.com" target="_blank">Go to this site</a>
For more information: https://www.w3schools.com/html/html_links.asp