We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Software

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

In HTML, what is a Link Tag?

By M.R. Anglin
Updated: May 16, 2024
Views: 10,756
Share

Contrary to what the name implies, the hypertext markup language (HTML) link tag does not define a hyperlink. Rather, it links an HTML document to an external document. Though it is most often used in connection with a style sheet, a link tag can also connect the document to another source, such as a bookmark, index, or chapter. Link tags should be inputted within the head tag, a tag located near the beginning of the HTML document. Unlike some of the other tags in HTML, the link tag has a start tag but no close tag.

One of the most common places the link tag is used is when it is linking a document to an external style sheet. A style sheet is a document that gives information on how the webpage is supposed to look. The convenience of a style sheet becomes apparent when it is used to control the look of several web pages at once. As long as each page in the website has a link tag to connect the page to the style sheet, an author can change the look of his website easily. All he has to do is change the appropriate element in the style sheet, and the changes will be reflected on all the pages on the website.

There are several different attributes that can be contained within a link tag, including the rel, type, and href attributes. The rel relates the connection the HTML document has to the linked file. For instance, rel=“stylesheet” communicates that linked file is a stylesheet. Other values that can be used with this attribute are the prev, next, and alternate values.

Another important attribute that can be included within the link tag is the type attribute. This attribute conveys the type of document the linked file is. When used in relation to a style sheet, the type will be text/css. Other types of documents include audio, video, and images. If the location of the external document needs to be inputted, the href attribute can be used. This attribute includes the uniform resource locater (url) to the external document.

Share
EasyTechJunkie is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.
Discussion Comments
Share
https://www.easytechjunkie.com/in-html-what-is-a-link-tag.htm
Copy this link
EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.

EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.