A Beginner’s Guide to CSS
Welcome to the beginner’s guide to CSS. Let’s begin with what that means: Cascading Style Sheets. We won’t go into a boring history lesson here. Suffice it to say that the web has become better because publishers (web page makers) have separated style from content.
With HTML, you create content and format it a certain way. With Style Sheets, you add the look and feel to what you are viewing. Let’s get right into it!
Before, you would write
<h1><font size=”3″ color=”red” face=”courier”>Hello World!</font></h1>
which is boring. Worse, if you need to edit the color or font, you have to do it for every instance. Even with search and replace commands, it’s futile. Separate the style from the content.
After, you should write <h1 class=”bell”>Hello World!</h1> on your page, and in a separate spot write:
.bell {
color:red;
font-family:courier;
font-size:3pt;
}
This way, you could “call up” the same style on many elements on the page, just by putting a class=”bell” in the markup selector. Then all you have to do is change the Style commands, not each instance where you want a red 3 point courier text header.
Related Posts:
