css syntax or Rules.

CSS syntax have been formed some of rules. The two main parts of a Rules, one of the selectors and the other declaration. Normally selector is a HTML elements by which can be styled. Each declaration consist of a property and a value. Properties is the type of element in which we can change. Every property has a value. Minimum a rule may have in a style sheet but generally there is more than one rule. When someone will visit your web site to any specific element of your HTML document how will be displayed to him is defined by each CSS rule.( As have been described below.)  A rule can be divided many parts ;and in every part of this kind are used for a specific purposes.1. First we need to define a selector. Which element of the html document we want to style that is informed by this selectors to the browser.II. Property name, is to write separately by colon(;).3. Values of properties are write separately by a semi-colon (;). Declaration is consist of this two pairs of properties and values.More than one declaration  may have in a single rule.For example:
” p” element has two properties which is described above. In fact, after the last declaration of block the semicolon is not required. But I advise you to give a semicolon at the end of each declaration. It is always will develop a habit of giving a semicolon at the end of your declaration that can give several advantages later.If you do not give semicolon of the declaration and the next declaration will be canceled.A second {} brackets and its inside declarations is called declaration  block. As CSS does not consider the free space and the number of lines.so I have written each declaration of a block of a separate line that properties are easy to understand separately. Notice that nothing has been changed a set of second brackets, semicolon has been given after each declaration everything is all right.Only difference is more than of one line the Declaration is written and some of the spaces has been given to facilitate the alignment. A CSS declaration will always end with a semicolon. and declaration groups will be bound by The second bracket. For example:CSS to make more understandable, per line can be written in one or more of the declaration.

Leave a Reply

Your email address will not be published. Required fields are marked *