Understanding the syntax of Css

syntax उन Rules को define करते है जिसका use Programming Language मे Statement का structure या Order define करने मे किया जाता है साथ ही यह यह भी specify करता है की statement और expressions को  बनाने के लिए  words और symbol को एक साथ कैसे रखा जाए। Css Html document मे Css Rules को apply करने के लिए भी Syntax का use करता है css syntax दो डाइफेरेंट parts मे divide रहता है।

1.Selector
2.Declaration

Selector - Selector  उस html element(body,div, ol, h1 etc) को define करता है जिस पर css Style को apply करना है

Declaration - declaration css properties और साथ ही साथ उस Properties की value को Contain करके रखता है

Syntax

Selector
                 {
                    Declaration 1;
                    Declaration 2;
                    .
                    .
                   .
                   .
                  Declaration N
                  }

इसे हम और अच्छी तरह से इस प्रकार समझ सकते है

Selector {
                    1st property:value;
                    1st property:value;
                    1st property:value;
                    .
                    .
                    .
                    .
                    Nth Property:value

                 }

Ex

       H1
              {
               Color:blue;
               Font-size:12px;
              }

यहा h1 एक selector है जो एक html element है जिस पर css style apply करनी है  { } एक declaration block है तथा color:blue और font-size:12px declaration है जिसमे color और font-size Properties और blue व 12px इन prperties की value है इस Statement का मतलब है की h1 element पर जो की html मे heading को define करने की लिए उस किया जाता है पर css का use कर color व font-size Properties को set किया गया है अतः h1 heading html document मे जहा भी होगी उसका text color blue और font-size 12 px होगी।

Comments