Can the order in which adding link and meta tags on head of a webpage have any adverse effect?

后端 未结 1 892
盖世英雄少女心
盖世英雄少女心 2021-01-15 16:23

I have added this code to my webpage with .php extension




        
1条回答
  •  囚心锁ツ
    2021-01-15 16:47

    Apart from a few exceptions, the order of childs in the head element doesn’t matter.

    That said, consumers like search engines may of course do what they want (e.g., ignoring every third element, just for the fun of it), but discussing the possible behaviour of undesignated consumers is off-topic here.

    The exceptions:

    • meta-charset should ideally be the first child (i.e., the element must be within the first 1024 bytes of the document, and at best before any non-ASCII characters)

    • base should ideally be the second child (i.e., it must come before any other element in head that has a URI as attribute value)

    • those link and script elements that the user agents wants to process are by default processed in the order they appear

    • the order of link-stylesheet and style elements can play a role for applying CSS

    • the first link-alternate with a type of application/rss+xml or application/atom+xml is "the default syndication feed for the purposes of feed autodiscovery"

    0 讨论(0)
提交回复
热议问题