HTML Standard for Head layout?

190 Views Asked by At

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!

3

There are 3 best solutions below

0
sp... On BEST ANSWER

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

0
Siddhesh damble On

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>
1
Mgasmi On

According to W3 should be:

  • Meta charset

  • Title

  • Stylesheet

  • JavaScript Files