CSS your HTML partner ! !

CSS your HTML partner! !

Click here to visit Our forum here!

Saturday, February 19, 2011

CSS Rules

CSS Syntax
Two main parts of CSS rule:
-a selector
-one or more declarations



Example:
h1
{color:blue;
font-size:12px;
}


The "h1" is a selector, the "color:blue;" is the first declaration, and "font-size:12px;" is the second declaration.


Each declaration consists of a property and a value. The "color" and "font-size" is known as a property, where else the "blue" and "12px" is known as the value. Each property has a value. CSS declarations always ends with a semicolon - " ; ", and declaration groups are surrounded by curly barckets - " { } ".


CSS Comments
Comments are used to explain you code, and may help when some one edit the source code at a later date. Those comments are ignored by brwsers.


A CSS comments begins with " /* ", and ends with " */ ".


Example:
/* This is a comment */
p
{
color:red;
/* This is another comment */
text-align:center;
}


References:
CSS Styling, CSS Syntax, [Onliine], Retrieved 19 Feb 2011.
URL: http://www.w3schools.com/css/css_id_class.asp

No comments:

Post a Comment