Introduction

While many scripts, icons, and stylesheets can be written straight into HTML markup, it is best practice and more efficient to include these resources in their own file and link them to your document. This topic covers linking external resources such as stylesheets and scripts into an HTML document.

Syntax

Parameters

Attribute | Details | ———–– | —–– |charset | Specifies the character encoding of the linked document |crossorigin | Specifies how the element handles cross origin requests |href | Specifies the location of the linked document |hreflang | Specifies the language of the text in the linked document |media | Specifies on what device the linked document will be displayed, often used with selecting stylesheets based on the device in question |rel | Required. Specifies the relationship between the current document and the linked document |rev | Specifies the relationship between the linked document and the current document |sizes | Specifies the size of the linked resource. Only when rel="icon" |target | Specifies where the linked document is to be loaded |type | Specifies the media type of the linked document |integrity | Specifies a base64 encoded hash (sha256, sha384, or sha512) of the linked resource allowing the browser to verify its legitimacy.|