The HTML links are hyperlinks that link one page to another page. You can click on a link and it will jump to another document. When you move your mouse pointer over a link, then your mouse pointer will turn into a little hand.
Let’s understand the concept in detail.
href attribute of HTML Anchor Tag
The “href” attribute plays a most important role in the HTML linking tag. A web page can contain many links that can take you directly to other pages. These links are known as hyperlinks. You can create hyperlinks by using text or images available on a webpage.
Types of Linking:-
In simpler way, linking can be categorised as follows –
- External Linking
- Internal Linking
Basically, a link outside a domain is referred as external link. In the HTML, the link is specified by using HTML tag <a>. The <a> tag stands for the anchor tag.
Syntax:- <a href=”url“>link text</a>
In this example, blog written on www.pristinetechschool.com is taking users to www.google.com ( different domain ) , when they click on “Open Google” written above, which is external linking.
As the name suggests, link to any webpage within the same domain is internal linking. Example:-
For example, when you will click on the courses, it will take you to the internal page- courses within the same domain.
The <base> tag is used to specify a base path for all the links in the HTML. When you want to link HTML documents related to the same website, then it’s not required to specify a complete URL for every link. The <base> tag is always specified in the header section of the HTML document. In the HTML document, you can set the base URL only once at the top of your page in the header section, then all subsequent relative links will use that URL as a starting point.
SET HTML LINK COLORS
In HTML, alink is an attribute. The alink is standing for an Active link. By default, the color of alink is red. Here, you can set a link color according to your color choice of the web page.
In HTML, vlink is an attribute. The vlink is standing for a Visited link. By default, the color of vlink is purple. Here, you can set a link color according to your color choice of the web page.
Link to an external style sheet
<link rel=”stylesheet” type=”text/css” href=”theme.css”>
Image Tag with Linking
Here, With the help of anchor tag, you can your image clickable.
Hope this blog post will help understanding the concept of linking in HTML better. Let us know if you have any suggestions for the published content on the site. Feel free to contact us if you wish to register yourself in our skill upgradation courses.
For more such content subscribe to our YouTube channel – https://www.youtube.com/channel/UCcWR1IezEQynJnAETgK8g2w?sub_confirmation=1 and follow us on facebook – https://www.facebook.com/pristinetechschool