Learn
HTML links
HTML links
HTML links, also known as hyperlinks, are used to navigate between web pages or different parts of the same page. Links are created using the <a>
tag, which stands for "anchor".
The <a>
tag can have couple of attributer:
- href attribute - it is an required attribute which specifies the URL or destination of the link.
- target attribute - can also be used to specify where the linked page should open.
By default, linked pages will open in the same browser window, but adding
target="_blank"
will open the link in a new tab or window.
Example:
Instructions
1.
Inside our ordered list, in the first item, let's add a link the the first word inside our paragraph (Greece
).
The link should be opened in a new tab, here is the link:
2.
Let's also link the first word in our paragraph inside the second item list (the word Italy
) in a new tab with the following link:
3.
Let's do the same for the last item list, inside the paragraph, the first word (Spain
) should be a link that opens in a new tab with the followig url:
Sign up to start coding
Already have an account?
Sign In
Course content