Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 96 - logicode 2609 C6
P. 96

    Declaration: This is a combination of a property and its value, written in the format property:
                         value;. For example: {COLOR: BLUE;}

                          Declaration Block: It is a set of one or more declarations enclosed in curly braces {}. Multiple
                         declarations inside the block are separated by semicolons. For example: {COLOR: RED;
                         FONT-SIZE: 16PX;}

                      For example:

                                                 Property   Value          Property       Value
                                                                                                      Declaration
                                 Selector    H1 {COLOR: RED; TEXT-ALIGN: CENTER;}
                                                                                                        Block

                                                     Declaration                 Declaration

                      So, when this code runs, all <H1> headings will appear red and centered on the page.

                                TYPES OF CSS

                      There are three main ways to add CSS to your web page:
                         Inline CSS

                         Internal CSS

                         External CSS

                      INLINE CSS

                      An Inline CSS is used to apply a unique style for a single element. Inline styles are added directly
                      to an HTML tag by using the STYLE attribute with the tag.
                      The syntax to define Inline CSS is as follows:

                      <TAG_NAME STYLE="PROPERTY:VALUE;">

                         Code      Write the HTML code to present the given web page using the STYLE attribute.
                           1

                      <!DOCTYPE HTML>
                      <HTML>

                      <HEAD>

                      <TITLE> Inline CSS</TITLE>
                      </HEAD>

                      <BODY>

                      <H1 STYLE="COLOR: GREEN;">

                      The Role of Plants</H1>

                       94   Premium Edition-VI

| 91 92 93 94 95 96 97 98 99 100 101 |