External Style sheets

External style sheets are great for applying the same styles to multiple pages on a website. Unlike internal styles, which need to be added to every single page, external style sheets can be imported directly from a .css file. The .css file must be linked from within the <head> section of your web code.

Here's the code to be placed between <head> and </head>:

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

Replacing cssfloat.css with whatever you named the CSS file.

If you want to take a look at the external style sheet contolling the CSS on CSSFloat.com, here it is - http://www.cssfloat.com/cssfloat.css

You can create a CSS file using any basic text editor, like NotePad. Instead of saving the document as .txt, hit the drop menu and select all files. You can then type in whatever.css and save the document as a cascading style sheet.

Benefits of External Style Sheets

The biggest positive of using CSS in external style sheets is mentioned above. The ability to apply the same styles to multiple pages, and thus the ability to change the whole look of a website by altering one .css file.

Other benefits include less code on your pages. Removing all of the on-page styles will reduce your page size. Consequently your pages will load slightly faster, the code will be easier to edit in future and search engine spiders will appreciate your greater keyword density!

Return to CSS Float HomePage.