There are three ways to define a new style.
Tags: ![]()
This will define a style for an existing tag. Simply click the arrow box and select a tag from the list. This is useful if you want all the tags on your page to have a certain property. For instance, if you want all visited links to have a certain color, select A:visited from the list, then define the properties of the style.
Class: ![]()
Here you can define a style with a name of your choosing. For example, you could define a style sheet named Bob. Then, anytime you want to apply the style Bob to a tag in your page, you would use class="Bob". This is useful if you want some tags, but not all of them, to have a certain style. For instance:
<P class="Bob">Hello</P>
<P>Hello</P>
The first "Hello" would have the properties of Bob, while the second would not.
ID- ![]()
An ID is similar to a class, except you should only use ID once per document. For instance, if you defined an ID named Tom, you should not do this:
<P ID="Tom">Hello</P>
<P ID="Tom">Welcome to my website</P>
IDs should only be used once, especially if you plan to do any scripting, as this may lead to errors in your script. If you need to use a certain style more once, use a class identifier instead of ID.
After you have defined a new style, the next step is to edit the properties of your style. This will define exactly how the style will act when you apply it to your page.
Rate This Article
You must be signed in to rate articles.