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
- How to create Right Aligned Menu Links using HTML and CSS ?
- How to create animated banner links using HTML and CSS?
- CSS | Links
- How to set cursor style to pointer for links without href ?
- How to use links on card-img-overlay class in Bootstrap 4 ?
- How to Create Navigation Links using HTML5 ?
- Express.js res.links() Function
- D3.js node.links() Function
- HTML | <html> Tag
- HTML Course | Structure of an HTML Document
- HTML Course | Basics of HTML
- HTML | DOM HTML Object
- HTML | <html> xmlns Attribute
- What is the difference between <html lang="en'> and <html lang="en-US'> ?
- Inline HTML Helper - HTML Helpers in ASP.NET MVC
- Web technologies | HTML and XML | Question 1
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.