Page 81 - Modular_V1.1_Flipbook
P. 81

08                                      CASCADING


                                                                                      STYLE SHEETS














                                    Your Aim

                                    to learn about:

                                        l    Selectors                 l    Link Style Sheet
                                         l    Background Color          l    CSS Border
                                         l    CSS Margins                l    CSS Height and Width
                                          l    CSS Outline                l    CSS Font
                                           l    Align Text                 l    CSS Float

                 ‘Cascading Style Sheet’ is commonly referred to as CSS. It is a simple design language which
                 enables to simplify the process of making web pages. It handles and describes how a HTML web
                 page will be presented on a web browser. It saves a lot of time as one design layout can be used
                 to make more number of web pages.

                 Using CSS, a web designer can control the text colour, font style, paragraph spacing, column size,
                 background images, layout designs, etc.
                     SELECTORS

                 CSS comprises of style rules that are interpreted by the web browser and then applied to the
                 corresponding elements in a document. Its style rule is made of two parts i.e. ‘Selector’ and
                 ‘Declaration’. ‘Declaration’ can be further categorized into ‘Property’ and ‘Value’.

                 Syntax: Selector {Property:Value}
                      Selector: It signifies or points to a HTML tag, to which a style will be applied. Selector could
                      be any tag like <H1>, <TABLE>, etc.
                      Property: It is a type of attribute (such as text colour, font style, paragraph spacing, etc.) of
                      HTML tag.
                      Value: It is the value assigned to the property. Value is always followed by ‘Property’ and
                      separated by ‘colon’.

                 A CSS declaration block is enclosed by curly braces and always ends with a semicolon. Declaration
                 block can contain one or more declarations separated by a semicolon.
                 Selectors can be defined in various ways. Some of the selectors are listed below:
                 Type Selector


                 Syntax: H1{COLOR:BLUE}
                 Here, H1 is the Selector and Blue is value of the Selector, COLOR is Property.


                                                                                          Cascading Style Sheets  79
   76   77   78   79   80   81   82   83   84   85   86