W3 Mind Logo
Home » Preloading Content With rel=”preload”

Preloading Content With rel=”preload”

Here is a basic example of Preloading the content on the webpages.

				
					<head>
  <meta charset="utf-8">
  <title>JS and CSS preload example</title>

  <link rel="preload" href="style.css" as="style"/>
  <link rel="preload" href="main.js" as="script"/>

  <link rel="stylesheet" href="style.css"/>
</head>

<body>
  <h1>Preloading Example</h1>
  <canvas></canvas>

  <script src="main.js" defer></script>
</body>
				
			

Here we preload our CSS and JavaScript files so they will be available as soon as they are required for the rendering of the page later on.

About Author
Picture of W3Mind

W3Mind

W3Mind focuses on Blogging, Make Money Online, SEO, Business Blogging, Social Media, WordPress, Internet Tools, Web Design and Development.
Give it a Share
Facebook
Twitter
LinkedIn
You May Also Like
How to
START A
BLOG
(step by step)
Load WordPress Sites in as fast as 37ms!