link rel="prefetch" - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:link

Introduction

Preemptively Fetching a Resource

You can ask the browser to preemptively fetch a resource.

The following code shows the use of the link element to specify prefetching.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
   <head> 
      <link rel="prefetch" href="/page2.html"> 
   </head> 
   <body> 
      <p>
          I like 
         <code id="myId">HTML</code>
          and CSS. <!--from ww w. j ava2 s  .co m-->
      </p> 
      <a href="http://java2s.com">Visit java2s.com</a> 
      <a href="page2.html">Page 2</a>  
   </body>
</html>

Related Tutorials