logo
g Text Version
Beauty & Self
Books & Music
Career
Computers
Education
Family
Food & Wine
Health & Fitness
Hobbies & Crafts
Home & Garden
Money
News & Politics
Relationships
Religion & Spirituality
Sports
Travel & Culture
TV & Movies

dailyclick
Bored? Games!
Nutrition
Postcards
Take a Quiz
Rate My Photo

new
European Travel
Action Movies
Bible Basics
Houseplants
Romance Movies
Creativity
Family Travel


dailyclick
All times in EST

Low Carb: 8:00 PM

Full Schedule
g
g HTML Site

BellaOnline's HTML Editor

g

Types Of CSS Rules

Guest Author - Diane Cipollo

In the last tutorial, you learned that a CSS rule is made up of a selector, property and value. Now we will discuss the three types of CSS rules.

HTML Selector
You were introduced to this in the last tutorial. The HTML selector is derived from the alpha/numeric portion of an HTML tag. That is, the stuff inside the < >. For example, the HTML selector for the <p> tag is p. This type of CSS rule is used to control the way an HTML tag behaves on the webpage. In our example, the CSS rule will control how the text between the opening <p> and closing </p> tags will be displayed.

Class
The Class command can be applied to any HTML tag. In fact it can be applied to multiple HTML tags on a webpage which makes it the most versatile. Unlike the HTML selector which is derived from a part of an HTML tag, you can give the Class command any name you want (following the CSS naming limitations). For example, we can create a Class command that will give the text a blue color and name this Class command blue. We can apply this blue Class command to both the HTML table cell tag <td> and the paragraph tag <p>. Then the text in the table cell and the text between the <p> tags will both be blue.

ID
This type of CSS rule is usually used to create an object to be used with DHTML or Javascript. Like the Class command you can give it any name you want and it can be applied to any HTML tag. But it can be applied only once on a webpage.

♦♦If you are interested in creating a website with HTML, you might be interested in reading the HTML Basics Series which will teach you the basics of HTML as you build a simple three-page website and create a webpage template that you can use to add more pages to this site.

♦♦You might also want to try the Flash Basics Series that will walk you through the process of building a website with MacromediaR FlashR. If you are new to Flash or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to be able to create a simple Flash based website.




This site needs an editor - click to learn more!

Add Types+Of+CSS+Rules to Twitter Add Types+Of+CSS+Rules to Facebook Add Types+Of+CSS+Rules to MySpace Add Types+Of+CSS+Rules to Del.icio.us Digg Types+Of+CSS+Rules Add Types+Of+CSS+Rules to Yahoo My Web Add Types+Of+CSS+Rules to Google Bookmarks Add Types+Of+CSS+Rules to Stumbleupon Add Types+Of+CSS+Rules to Reddit




RSS | Related Articles | Editor's Picks Articles | Top Ten Articles | Previous Features | Site Map


For FREE email updates, subscribe to the HTML Newsletter


Past Issues


print
Printer Friendly
bookmark
Bookmark
tell friend
Tell a Friend
forum
Forum
email
Email Editor


Content copyright © 2014 by Diane Cipollo. All rights reserved.
This content was written by Diane Cipollo. If you wish to use this content in any manner, you need written permission. Contact BellaOnline Administration for details.

g


g features
What's Coming in HTML 5

What is FTP?

HTML Fundamentals - Tables

Archives | Site Map

forum
Forum
email
Contact

Past Issues
memberscenter


vote
Poetry
Daily
Weekly
Monthly
Less than Monthly



BellaOnline on Facebook
g


| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2014 Minerva WebWorks LLC. All rights reserved.


BellaOnline Editor