TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

HTML link tag

HTML link tag with examples, forms, input, text, anchor, image, heading, marquee, textarea, paragraph, title, quotes, code etc.

<< Back to HTML

HTML <link> tag

HTML <link> tag is used to specify the relationship between the current document and external source.

The <link> tag is commonly used to link the external Stylesheet for the current document, but it can also use with link site icons. It is placed on the head section of the document.

Example

<link rel="stylesheet" type="text/css" href="">

Following are some specifications about the HTML <link> tag

Display None
Start tag/End tag Both Start and End tag
Usage textual

Example

<!DOCTYPE html>
<html>
<head>
	<title>Link Tag</title>
	<link rel="stylesheet" type="text/css" href="htmlpages/css/link.css">
</head>
<body>
	<h2>Example of Link Tag</h2>
	<p>This is paragraph which is styled with external style sheet. </p>
</body>
</html>
Test it Now

body{
	background-color: #7ac5cd;
		text-align: center;}
h2{
	color: #006400;}

p{
	color: #cd5c5c;
	font-size: 25px;
	font-style: italic;}

Output:

HTML link tag

Attribute:

Tag-specific attributes:

Attribute Value Description
charset char_encoding It defines the character encoding of linked source. (Not supported in HTML5)
href URL It specifies the location of the linked document.
hreflang language_code Specifies the text language of linked source.
media media_query It specifies the media, for which linked source is applied.
rel
  • alternate
  • author
  • dns-prefetch
  • help
  • icon
  • license
  • next
  • pingback
  • preconnect
  • prefetch
  • preload
  • prerender
  • prev
  • search
  • stylesheet
It describes the relationship between the current document and linked document. (required)
rev reversed
relationship
It describes the relationship between the linked document and the current document. (Not supported in HTML5)
sizes Height* weight It specifies the size of the linked source. It should be only used with rel="icon."
target _blank
_self
_top
_parent
frame_name
It determines where to load the linked document.
type media_type It specifies the media type of document.

Global attribute:

The <link> tag supports the global attributes in HTML

Event attribute:

The <link > tag supports the event attributes in HTML.

Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<link>YesYesYesYesYes
Next TopicHTML Tags List




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf