What is a link?
It is a connection from one web resource to another.A link has two ends,An anchor and direction. The link starts at the “source” anchor and points to the “destination” anchor, which may be any Web resource such as an image, a video clip, a sound bite, a program, an HTML document or an element within an HTML document.
HTML Link Syntax
Links are specified in HTML using the “a” tag.
href : The href attribute is used to specify the destination address of the link used. Text link : The text link is the visible part of the link.
An internal link is a type of hyperlink whose target or destination is a resource, such as an image or document, on the same website or domain.
Changing Link Colours in HTML
Different types of links appear in different formats such as:
- An unvisited link appears underlined and blue in colour by default.
- A visited link appears underlined and purple in colour by default.
- An active link appears underlined and red in colour by default.
The appearances of links can be changed by using CSS.
The Target Attribute in Links
The target attribute is used to specify the location where the linked document is opened.The various options that can be used in the target attribute are listed below in the table:
Using Image as a Link in HTML
An image can be used to create a link to a specified url.
Creating a Bookmark Link for a Webpage
A bookmark is a link that can be used to jump to specified portion of a webpage.Bookmarks are very useful if a webpage is quite long.
Steps to create a bookmark are:
1. Using the id attribute,create a bookmark.
2. Add the specified portion of the webpage to the bookmark.
Creating a download link in HTML
A text link of a pdf,doc or zip file can be created to make it downloadable.
- HTML | DOM links Collection
- CSS | Links
- How to set cursor style to pointer for links without href ?
- HTML Course | Structure of an HTML Document
- HTML | DOM HTML Object
- HTML Course | Basics of HTML
- PHP vs HTML
- HTML | <ol> Tag
- HTML | <q> Tag
- HTML | <a> Tag
- HTML 5 | <wbr> Tag
- HTML | <u> Tag
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.