
Lesson Three
Welcome to Lesson Three!
How Do I Use CSS? CSS is short for Cascading Style Sheets. In other words, instead of using the <body bgcolor="ffffff"> (or whatever color you want) tag, you can use style sheets, which are extremely easier to use and edit. A style sheet is placed in the head (see Lesson One ). A basic CSS document when placed in the head, looks like this.
<style type=text/css>
body {bg color:ffffff:}
</style>A full listing of CSS attributes can be found here
As you can see, it's specifying the tags effected by the stylesheet, in this case the everything between the <body> and </body> tags. You can set it up to effect only certain areas of the page. Here's how -
<style type=text/css>
.name { -- your attributes -- }
</style>Then type the following code in the body.
<span class="name">
-- affected areas --
</span>If the affected area is a paragraph then you can use the <p> tag to support the class tag ( <p class="name"> -- affected areas -- </p> )
You can also make a external CSS document and have your page import the properties of the CSS document. I use this method consistently.
To do so, enter the following code:<link href="URL" rel="stylesheet" type="text/css">
Easy, huh?
Your external document should have all the normal CSS content, minus the "<style>" and "</style>" tags at the beginning and end. Start it in Notepad or TextEdit and save it with a .css extension.
You can also apply CSS styles to anything between certain HTML tags such as "a" (that will make your links show up different from the default) or basically any tag.
<style type=text/css>
tag { -- your attributes -- }
</style>Anything between the tags will have your attributes.