CSS is one of my newer discoveries, and I'm sure I'm not yet using it to its fullest potential. However, even with what I do know, I've realized that it makes things a whole lot easier to code.
Basically, CSS lets you define a set of styles. You can then apply that set of styles to pieces of your website. For example, to make this block of code display as it does...
<link rel='stylesheet' type='text/css' href='stylesheet.css'>
...all I had to do was give its <p> tag the attribute: class="code". Now, I also had to define what the "code" class does in an external file. That's what the above line of code lets me do, by the way. It tells this page to "read" all of the stylesheets.css file, and every time I add the "class=(whatever)" attribute, it'll look to the stylesheets.css file to see if it should apply styles.
How does this help? Enormously. I'd have to add a handful of tags (font, div, b, etc.) to every instance of my special "block of code" format. And of course, every time I wanted to change how it looks on my site, I'd have to edit every instance. However, because I'm using an external CSS file, each instance of the class="code" attribute simply points to the same location. If I wanted to make the background bright pink, I'd just have to add one line to stylesheets.css.
And again, since I'm not equipped to make a complete tutorial, I will just link to one here: PageResource.com's CSS Tutorials. Just for the record, CSS is a fairly small topic, and there's not a whole lot to learn before you know all of it. It's also very easy to learn and implement.
The Basics | Organization | Formatting with CSS Adding PHP | Some Fun Extras
|