Ask an SEO Expert...
SEO Resources

Ordering JavaScript and CSS for SEO

Page speed is an important part of on-page SEO and there is an easy way to give your web pages an advantage. By simply changing the order in which external CSS style sheets and JavaScript elements are loaded, you can reduce the time it takes to display your page!

The following example shows that CSS called after the JavaScript must wait for the scripts to load before the remaining CSS gets read, causing a delay.

  <head>  <link rel="stylesheet" type="text/css" href="stylesheet1.css" />  <script type="text/javascript" src="scriptfile1.js" />  <script type="text/javascript" src="scriptfile2.js" />  <link rel="stylesheet" type="text/css" href="stylesheet2.css" />  <link rel="stylesheet" type="text/css" href="stylesheet3.css" />  

By putting the CSS above the JavaScript in your HTML, the CSS can load in parallel, reducing the time it takes to load all elements.

  <head>  <link rel="stylesheet" type="text/css" href="stylesheet1.css" />  <link rel="stylesheet" type="text/css" href="stylesheet2.css" />  <link rel="stylesheet" type="text/css" href="stylesheet3.css" />  <script type="text/javascript" src="scriptfile1.js" />  <script type="text/javascript" src="scriptfile2.js" />  

Delivering Results For...