Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 95 - 2611_SmartGPT Pro V(5.0) C-6
P. 95

    Value: This is the setting or value assigned to the property. This could be a colour, size, position,
                       etc. For example, RED, 16PX, CENTER. Each property has its own valid set of values.

                        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 1. Write the HTML code to present the given web page using the STYLE attribute.

                     <!DOCTYPE HTML>

                     <HTML>
                     <HEAD>

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

                     <BODY>
                     <H1 STYLE="COLOR: GREEN;">

                     The Role of Plants</H1>
                     <P STYLE="BACKGROUND-COLOR: YELLOW; COLOR: BLUE;">

                                                                                                   CSS3—Styling Basics  93

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