Where to insert JS and CSS files into HTML? [duplicate]

-3

Thinking about performance, in which part of HTML should I insert CSS and JS files. I know that JS files should be inserted before closing the </body> tag so as not to block loading and if possible assíncrona , but what about CSS?

    
asked by anonymous 07.08.2017 / 22:15

1 answer

-1

In my opinion, the best practice is to place the CSS inside the head tag:

<head>
  <link rel="stylesheet" href="css/layout.css" type="text/css">
</head>

And the Javascript files before closing the body tag:

  <script type="text/javascript" src="script.js"></script>
</body>

Translated by: Where to put CSS and Javascript

    
07.08.2017 / 22:17