HTML <link> tag(element)

the html <link> tag defines link between a document and an external link resource.

the html <link> element may only appear in the <head> section of a document.

the html <link> tag has not end tag.

the <link> tag does not encapsulate any text.

link tag syntax: <link src="" />.

<link> element links an external style sheet to a document,<link> type attribute indicate style sheet language and media att specifies the media type for style .

link and search engines

the <link> element to provide a variety of information to search enfines.

  • links to alternate versions of a document,written in another human language.
  • links to alternate versions of a document,designed for different medis,for instance a version especially suited for printing
  • links to the starting page to a collection of documnets.

 <html>
     
    <head>
    
      <title> link element is used for work </title>
      
      <link   type="text/css"  href="./css/screen.css" media="screen" >
      
     <link   type="text/javascript"  href="./java_script//javascript.js" >
     
    <link   rel="next"   href="./chapter3.html" >
      
    <link   rel="pre"   href="./chapter2.html" >
    
    <link   rel="alternate" hreflang="en" href="./code.html" type="text/html">
    
     </head>
    
      <body>
     
   </body>
  
   </html>

html link element attribute

attributevaluedescription
charsetcharencodingthe charachter encoding of the link document
hrefurllocation of the linked document
hreflanglanguage_codespecifies the language ot the linked documnet
mediamedia typesfor media
rel
  1. alternate
  2. archives
  3. author
  4. external
  5. first
  6. help
  7. icon
  8. last
  9. license
  10. next
  11. nofollow
  12. noreferrer
  13. pingback
  14. prefetch
  15. prev
  16. search
  17. sidebar
  18. stylesheet
  19. tag
  20. up
the relationship between the current documnet and destination
revbackward relationshipthe relationship between the destination and the current document
typemime typethe mime type of the destination

global attributes

the <link> tag also support the global attributes.

event attribute

the html <link> tag also support the event attributes.