Publish in HTML Tutorial el 24/05/2025 16:36
The <link> HTML element specifies relationships between the current document and external resources. This element is most commonly used to link to stylesheets, but is also used to establish site icons (favicons) and other relationships between documents.
Key attributes of <link>:
Here's how a basic <link> element looks in HTML:
The most common use of <link> is to connect an external CSS file to your HTML document.
The <link> element is used to specify favicons for your website.
You can use <link> with rel="preload" to tell the browser to start loading critical resources early.
This example shows how to use JavaScript with <link> to switch between stylesheets.
How does it work?
This example demonstrates how to dynamically load a CSS file using JavaScript.
<link rel="dns-prefetch" href="//domain.com">
to perform DNS lookups for external domains in advance.media
attribute allows you to load different stylesheets for different devices or screen sizes.crossorigin="anonymous"
to ensure proper CORS handling.The <link> element is supported by all browsers, though some relationship types (like preload) may have varying support in older browsers.
The <style> HTML element contains style information for a document, or part of a document. ...
The <strong> element is used to indicate that its content has strong importance, seriousnes...
The <span> element is an inline container used to mark up a part of a text or document. Unl...
The <source> element is used to specify multiple media resources for media elements like &l...
The <small> element is used to represent side-comments and small print, typically for discl...
HTML <section> Element: The Complete Guide The <section> element is a semantic HTML ...