External CSS Stylesheets Speed Site Loading

In you blog on blogger, you probably have a long list of tags in your embedded stylesheet. Proffessional web designers prefer to host external CSS stylesheets.

External CSS stylesheets are cached in the browsers, such that if a user visits few different pages of your site, they are extracted from the browser cache directly and not loaded repeatedly since they are the same for all pages. So your page loads faster. Moreover, just a simple change in CSS can change your whole website look. So web designers just love this.

If you embed the CSS stylesheet as in Blogger, then everytime the browser reads the whole CSS repeatedly, and if you have customized your blog extensively with long cool CSS files, then it will take longer to load.

It is very simple to link to a style sheet, here is the general form:

<LINK rel="stylesheet" type="text/css" name="anyname" href="url" mce_href="url">

The rel=”stylesheet” attribute just says to look for a stylesheet. The type=”text/css” tells the browser the mime type of the document, which is a cascading style sheet. The name=” ” attribute allows you to give the style sheet a name (optional). The xhref=” ” attribute is where you place the url of the style sheet. You can use an absolute or relative url, as long as you point the browser to the .css file you wish to use. These tags go to the HEAD section of that page and needs to be added to all pages that it is used in.

External stylesheets require web hosting
First you need webshosting to host the CSS file. Blogger has no web storage facility for CSS files, they have embedded CSS stylesheets by default. I can host CSS stylesheets on my Dreamhost webhosting space I bought recently.

Why don’t I use external stylesheets?
If your website and CSS stylesheets run on the same webshosting, then if by chance your server is down, then both do not work. But If I run my blog on Blogspot and host on Dreamhost, then if the Dreamhost server is down for some reason, my blogger blog will be without CSS styling and look bad. So currently I am sticking to embedded stylesheets in Blogger.

Share with friends

About the Author: P Chandra is editor of QOT, one of India's earliest tech bloggers since 2004. A tech enthusiast with expertise in coding, WordPress, web tools, SEO and DIY hacks.