Page 33 - modular_v2.0_HTML&_CSS_Fb
P. 33

Syntax:

                 *{
                 PROPERTY: VALUE;

                 }
                 For example:
                 * {

                 COLOR: BLUE;
                 }
                 Type Selector

                 The Type Selector in CSS is used to target all elements of a specific type (HTML tag) and apply
                 styles to them. It is also known as the Element Selector because it selects elements based on

                 their tag names.
                 Syntax:
                 ELEMENT {

                 PROPERTY: VALUE;
                 }

                 For example:
                 P{
                 TEXT-ALIGN:CENTER;

                 COLOR: RED;
                 }

                 All HTML paragraphs on the web page will be centre-aligned and displayed in red colour.
                    TYPES OF CSS

                 There are three types of CSS:

                      External CSS
                      Internal CSS
                      Inline CSS
                 External CSS


                 By using External CSS, look of an entire website can be changed by updating just one CSS file.
                 To do so:
                 Web page must include a reference to the External CSS file within a <LINK> element inside the
                 <HEAD> section. Syntax to define LINK in the web page:

                 <HEAD>
                 <LINK REL="stylesheet" TYPE="text/css" HREF="name of style sheet">

                 </HEAD>


                                                                                                                31
                                                                                        Cascading Style Sheets
   28   29   30   31   32   33   34   35   36   37   38