What does <link> tag do besides including stylesheets?

前端 未结 6 1165
南笙
南笙 2021-02-19 20:31

I know that the HTML tag is used for attatching stylesheets, but looking at the W3CSchools tag reference, it has many other values for the rel attribute. I\'ve looked

6条回答
  •  难免孤独
    2021-02-19 21:07

    It links ;)

    It's a way to say "this other resource and I (the HTML document) have a relationship."

    The rel attribute says what the linked item is to the HTML document.

    The rev attribute says what the HTML document is to the linked item.

    So...

    
    

    Says "style.css is the style sheet for this HTML document."

    Silly analogy: If HTML documents could be 'married' (in highly conservative no-same-sex-marriages) we could do something like this:

    
    

    With this element, the HTML document is saying that "otherFile.html is my wife, and I am its husband."

提交回复
热议问题