Category Archives: css

How do I externalize my CSS?

It amazes me that one of the most basic SEO things you can do is externalize your CSS. It’s not that hard either! The best site to look at for the largest mistakes in CSS is Yahoo.com. You would figure that they would have fixed this by now.

Go to Yahoo.com and view source, you will see what I am talking about.

In a few simple steps you too can externalize your messy CSS.

1. Copy your CSS, in this case we will grab one class from Yahoo.com source code.

In your source code copy the CSS to your blank file.

Source:

.md{
background:#fff;
border:1px solid #b0bec7;
}

2. Save your file and upload it to your server.
3. Make sure you can see the file on your server before changing your source code, just point your browser to where you uploaded thee file. It will load.
4. Now you need to remove the CSS and point to your external file.

In your head tags between Head /Head, put the following line in. Replace the URL with your own URL.

[link href="http://mysite.com/css/mysite.css" type="text/css" rel="stylesheet"][link href="http://www.mysite.com/css/mysite.css" rel="stylesheet"]

** Replace the [] with <>, blogger would not let me easily post exact HTML.

Presto you are done! Nothing too it, now you can shrink your source code down.

Doing this to Java Script is far more complicated.