CSS (Cascade Style Sheets)
CSS
is used commonly by web designers to tell the web browsers to display their
web pages in interesting ways by applying CSS rules to specific HTML tags.
To learn HTML tags you can visit our HTML tutorial.
CSS has three types of rules:
1. HTML selector: This rule
is applied to the HTML tags to tell them how to display the content in
the tags. For example, p is the selector of <p> tag.
Example:
p{color: green;}
2. ID selector:
This rule is usually applied once on the page to a particular HTML tag
to create a unique object that can work with JavaScript code.
Example:
#menu{
margin:0;
padding:0
}
3. Class selector:
This rule can be applied to any HTML tags.
Example:
.myclass{
font-size:20pt;
}
|