link ref='' - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:link

Introduction

Selected Values for the rel Attribute of the link Element

ValueDescription
alternate Links to an alternative version of the document
authorLinks to the author of the document.
help Links to help related to the current document.
icon Specifies an icon resource.
license Links to a license associated with the current document.
pingback Specifies a pingback server
prefetch Preemptively fetches a resource.
stylesheet Loads an external CSS stylesheet.

Loading a Stylesheet

The styles.css File

a {
    background-color: grey;
    color: white;
    padding: 0.5em;
}

Using the link Element for an External Stylesheet

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
   <head> 
      <link rel="stylesheet" type="text/css" href="styles.css"> 
   </head> 
   <body> 
      <p>
          I like 
         <code id="myId">HTML</code>
          and CSS. <!--from w w  w . j  a v a  2s .c  o  m-->
      </p> 
      <a href="http://java2s.com">Visit java2s.com</a> 
      <a href="page2.html">Page 2</a>  
   </body>
</html>

Related Tutorials