CSS3

Introduction to CSS Syntax

Each formatting instruction that you declare in your CSS document is defined as a CSS rule The process of designing your unique web site look and feel is creating enough CSS rules in order to implement your design concept to its completion.

Listing 1: Introduction to CSS Syntax
Basic format of a CSS Rule:
                    
                        selector { property: value; }
                    
                
CSS rule
A CSS rule consists of two parts: the first is a selector and the second is a declaration block. In Listing 1 the declaration block is highlighted in yellow and enclosed withing the curly braces {}.
declaration block
The declaration block contains one or more declarations separated by semicolons.
declaration
Each declaration includes a CSS property name and a value pair, separated by a colon.
selector
A CSS selector is the part of a CSS rule set that actually selects the content you want to style.
property
A CSS property is the part of a CSS rule set that selects the character or quality of the selector such as color, height, weight, etc.
mathsisfun.com
value
A CSS value is the part of a CSS rule set that specifies the numerical worth of the selectors property. In this case it is the number or numbers that represent the selectors property setting that you desire in you web page design.