Page 108 - HTML5
P. 108
Chapter 24: Linking Resources
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
• <link rel="link-relation" type="mime-type" href="url">
• <script src="path-to-script"></script>
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
Specifies on what device the linked document will be displayed, often used with
media
selecting stylesheets based on the device in question
Required. Specifies the relationship between the current document and the
rel
linked document
Specifies the relationship between the linked document and the current
rev
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
Specifies a base64 encoded hash (sha256, sha384, or sha512) of the linked
integrity
resource allowing the browser to verify its legitimacy.
Examples
https://riptutorial.com/ 92

