Thursday 8 March 2012

Syntax

CSS has a simple syntax and uses a cardinal of English keywords to specify the names of assorted appearance properties.

A appearance area consists of a account of rules. Anniversary aphorism or rule-set consists of one or added selectors and a acknowledgment block. A declaration-block consists of a account of declarations in braces. Anniversary acknowledgment itself consists of a property, a colon (:), and a value. If there are assorted declarations in a block, a semi-colon (;) charge be amid to abstracted anniversary declaration.2

In CSS, selectors are acclimated to acknowledge which of the markup elements a appearance applies to, a affectionate of bout expression. Selectors may administer to all elements of a specific type, or alone those elements that bout a assertive attribute; elements may be akin depending on how they are placed about to anniversary added in the markup code, or on how they are nested aural the Document Object Model.

Pseudo-classes are addition anatomy of blueprint acclimated in CSS to analyze markup elements, and in some cases, specific user accomplishments to which a accurate acknowledgment block applies. An often-used archetype of a pseudo-class is :hover, which applies a appearance alone back the user 'points to' the arresting element, usually by captivation the abrasion cursor over it. It is added to a selector as in a:hover or #elementid:hover. Added pseudo-classes and pseudo-elements are, for example, :first-line, :visited or :before. A appropriate pseudo-class is :lang(c), "c".clarification needed

A pseudo-class selects absolute elements, such as :link or :visited, admitting a pseudo-element makes a alternative that may abide of fractional elements, such as :first-line or :first-letter.

Selectors may be accumulated in added means too, abnormally in CSS 2.1, to accomplish greater specificity and flexibility.3

Here is an archetype accretion up the rules above:

No comments:

Post a Comment