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

女生的网名这么多〃 提交于 2019-12-04 02:09:39

问题


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

<?php include_once("cssheadertop.php")?>
<link rel="stylesheet" href="button.css">
<?php include_once("cssheaderbottom.php")?>

Now, cssheadertop.php contains the following code

<head>
<meta charset="utf-8">
<title>8mags - CSS Lessons</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../../bootstrap.min.css" media="screen">
<link rel="stylesheet" href="../../style.css">
<link href='http://fonts.googleapis.com/css?family=Roboto+Condensed' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Coda' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

The cssheaderbottom.php file has following code

  <style>
  page specific style here.
  </style>
  </head>

I want to add meta description and meta keywords tag between

 <?php include_once("cssheadertop.php")?> 

and

 <?php include_once("cssheaderbottom.php")?>

just like the link tag I have added.

Can it pose any problem in rendering or SEO?


回答1:


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 "the default syndication feed for the purposes of feed autodiscovery"



来源:https://stackoverflow.com/questions/27576959/can-the-order-in-which-adding-link-and-meta-tags-on-head-of-a-webpage-have-any-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!