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 animated banner links using HTML and CSS?
- How to create Right Aligned Menu Links using HTML and CSS ?
- CSS | Links
- Express.js res.links() Function
- How to Create Navigation Links using HTML5 ?
- How to set cursor style to pointer for links without href ?
- How to use links on card-img-overlay class in Bootstrap 4 ?
- Inline HTML Helper - HTML Helpers in ASP.NET MVC
- HTML Course | Structure of an HTML Document
- HTML | <html> xmlns Attribute
- HTML Course | Basics of HTML
- HTML | DOM HTML Object
- What is the difference between <html lang="en'> and <html lang="en-US'> ?
- HTML | col Tag
- HTML | <ol> Tag
- HTML | <pre> Tag