एचटीएमएल <लिंक> टैग
उदाहरण
बाहरी स्टाइल शीट से लिंक करें:
<head>
<link rel="stylesheet" href="styles.css">
</head>
परिभाषा और उपयोग
<link>
टैग वर्तमान दस्तावेज़ और बाहरी संसाधन के बीच संबंध को परिभाषित करता है ।
टैग का <link>
उपयोग अक्सर बाहरी स्टाइल शीट से लिंक करने या आपकी वेबसाइट पर फ़ेविकॉन जोड़ने के लिए किया जाता है।
<link>
तत्व एक खाली तत्व है, इसमें केवल विशेषताएँ होती हैं ।
ब्राउज़र समर्थन
Element | |||||
---|---|---|---|---|---|
<link> | Yes | Yes | Yes | Yes | Yes |
गुण
Attribute | Value | Description |
---|---|---|
crossorigin | anonymous use-credentials |
Specifies how the element handles cross-origin requests |
href | URL | Specifies the location of the linked document |
hreflang | language_code | Specifies the language of the text in the linked document |
media | media_query | Specifies on what device the linked document will be displayed |
referrerpolicy | no-referrer no-referrer-when-downgrade origin origin-when-cross-origin unsafe-url |
Specifies which referrer to use when fetching the resource |
rel | alternate author dns-prefetch help icon license next pingback preconnect prefetch preload prerender prev search stylesheet |
Required. Specifies the relationship between the current document and the linked document |
sizes | HeightxWidth any |
Specifies the size of the linked resource. Only for rel="icon" |
title | Defines a preferred or an alternate stylesheet | |
type | media_type | Specifies the media type of the linked document |
वैश्विक गुण
<link>
टैग HTML में वैश्विक विशेषताओं का भी समर्थन करता है ।
घटना गुण
<link>
टैग HTML में ईवेंट विशेषताओं का भी समर्थन करता है ।
संबंधित पृष्ठ
HTML ट्यूटोरियल: HTML शैलियाँ
HTML DOM संदर्भ: लिंक ऑब्जेक्ट
डिफ़ॉल्ट सीएसएस सेटिंग्स
अधिकांश ब्राउज़र <link>
निम्न डिफ़ॉल्ट मानों के साथ तत्व प्रदर्शित करेंगे:
link {
display: none;
}