Page 291 - DCAP109_GRAPHIC_TOOLS
P. 291

Graphic Tools




                    Notes          12.5.8 Grouping Properties

                                   CSS allows you to group declarations by separating them with semi-colons.


                                          Example:
                                   p
                                   {
                                   color:blue;
                                   text-align:center;
                                   }

                                   You can group selectors too using commas rather than semi-colons.

                                          Example:

                                   h1,h2,p
                                   {
                                   color:green;
                                   }

                                   12.5.9 Inheritance of Properties

                                   Using inheritance we can apply CSS rules to more than one tag.
                                   For example, if you set <body> tags to the colour blue, then the tags included within a <body>…</
                                   body> tag inherit that property and are also blue in color.
                                   Another use of inheritance is within HTML tags that involve a parent-child relationship, such as
                                   a list. Whether numbered (ordered, <ol>) or bulleted (unordered, <ul>), a list comprises any
                                   number of list items, designated by <li> tags. Each list item is considered a child of the parent
                                   tag, <ol> or <ul>.


                                          Example:
                                   ol {

                                   color:red;
                                   }
                                   ul {
                                   color:red;
                                   }

                                   Self Assessment

                                   Fill in the blanks:
                                   11.  …………………… are a collection of formatting rules that control the appearance of content
                                       in a web page.





          284                               LOVELY PROFESSIONAL UNIVERSITY
   286   287   288   289   290   291   292   293   294   295   296