css lesson 2

Why use CSS?

Sure you can add funky style to your webpages by using attributes in all the individual html tags thoughout the code of your webpages, but if you have a large website there's a few things to take into consideration.

For starters, there's webspace - the space your web host provides you with. The more attributes you have, the longer your code is and the larger your files are and more webspace is needed to host them. On top of that, the larger your files are the more bandwidth gets used up each time your page is loaded into a browser and the more time it takes for your pages to load.

If that isn't enough, say you had a website with 100 or more pages and you wanted to give the whole site a bit of an overhaul and give it a fresh look, could be something as simple as changing colour(or color for any Americans out there reading this) of the text displayed in your pages. If your colour was defined in the font tags you would have to go through each of your 100 pages individually and manually change each and every one of those font tags, what a nightmare... but with CSS you can have those colour attributes defined in a single external cascading style sheet, make one little edit in that one style sheet, say "abracadabra" and and you've changed the colour of your text throughout your whole website. Pretty nifty huh?? and what's more, it will even work without saying "abracadabra"!!!

So in essence, CSS allows a web designer to control the look and layout of multiple webpages all at once, making it more economical to run and maintain websites in a number of ways.


In our next lesson, we'll take a look at the different types and uses of CSS.



Lesson added Tuesday 16th December 2008