You’ve heard of people talking about having a site made using CSS, otherwise known as Cascading Style Sheets. So you decide to have a look at this CSS stuff only to discover that it makes no sense. How can somebody make a site out of this? Well, to put it bluntly, they don’t make a site with CSS; rather they make the site just as they would any other site, using good old HTML and link their page(s) to a CSS file. This file holds all the information on how the page will look; from what color the background is, to what font the body of the site will use.
CSS: Where Little Things Mean a Lot - On to CSS (Page 2 of 3 )
I can tell you want to get right to it and give the CSS stuff a go, so go ahead and make a file called ‘style.css’ and save it in the same folder as the HTML page you just made. Open it with a simple text editor, like Notepad, and add the following code:
Now go and have a look at your web page again in your browser… a bit different isn’t it? Sure you could have done that with much less code by simply using <font> tags and <center> tags etc., but the main problem with this is that such tags are soon to be deprecated, and CSS is going to completely take over the way we do web design. Also, if you wish to have a ‘vaild’ (according to the W3C) site, you will have to use CSS and not rely on these <font> tags, etc. That’s just the reason why you almost have to do this, but you should be looking at doing this anyway, as when you make your next page, all you have to do is add one simple line:
It will look exactly like your first page! You wont need to add all those <font> tags any more! And, the best part is that when you decide your site doesn’t look good with those colors or the chosen layout, all you have to change is the CSS file, as opposed to every HTML page you have created. Voila! Or Viola! Whichever it is, you’re done! Your entire site has a new, better and fresher look.