-1

I've seen many different layouts, and I'm not sure if there is a standard.

Is there a proper way to order <title>, <meta>, <link>, and <script> elements in the head?

I'm fairly new to web development and would like to make good habits from the start if possible.

Thanks in advance!

FrankieD
  • 411
  • 2
  • 10
  • 3
    Possible duplicate of [What are best practices to order elements in ?](https://stackoverflow.com/questions/1987065/what-are-best-practices-to-order-elements-in-head) – caramba Jun 11 '18 at 13:32

3 Answers3

2

No, You can add title, meta, link, and script anywhere you want in head section.

sp...
  • 61
  • 4
0

You can follow the below example.

<html lang="en">
<head>
  <meta charset="utf-8">

  <title>HTML Site title</title>
  <meta name="description" content="description here">
  <meta name="author" content="site author">

  <link rel="stylesheet" href="css/styles.css?v=1.0">

  <!--[if lt IE 9]>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script>
  <![endif]-->
</head>

<body>
your code here
  <script src="js/scripts.js"></script>
</body>
</html>
0

According to W3 should be:

  • Meta charset

  • Title

  • Stylesheet

  • JavaScript Files

Mgasmi
  • 417
  • 3
  • 13
  • The site you have linked to is MDN not W3C. And the page says nothing about a specific order. – Turnip Jun 11 '18 at 13:52