Page 88 - Plus_V2.2_C7_Flipbook
P. 88

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. Let us look at some examples.

                  Example: H1{COLOR:BLUE}
                  Here, H1 is the Selector and Blue is value, COLOR is Property.
                  In this case, all the elements of H1 will appear in Blue colour.
                  Example:      P {

                                TEXT-ALIGN: CENTER;
                                COLOR: RED;
                                }
                  In this case, all the elements of <P> tag will be center-aligned, with red text color.


                         LINK STYLE SHEET


                  There are three ways of inserting or linking a style sheet:
                     External Style Sheet
                     Internal Style Sheet
                     Inline Style Sheet

                       External Style Sheet

                  External style sheet involves placing the CSS rules in a separate file (e.g., styles.css) and linking that
                  file to multiple HTML documents. This method is suitable for larger projects where styles need to be
                  shared across multiple pages.
                  By using ‘External Style Sheet’, 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 style sheet 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_STYLESHEET.css">
                  </HEAD>
                  Attributes used within the <LINK> element:
                     REL: Specifies the relationship between the HTML document and the linked resource. In this case, it
                    indicates that the linked resource is a style sheet.

                     TYPE: Specifies that the style sheet is written in CSS. In this case, it indicates that the linked resource
                    is written in CSS.
                     HREF: Specifies the URL or path to the external CSS file. Replace "NAME_OF_STYLESHEET.css" with
                    the actual name and location of your CSS file.

                  86    Premium Edition-VII
   83   84   85   86   87   88   89   90   91   92   93