Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 97 - logicode 2609 C6
P. 97

    <P STYLE="BACKGROUND-COLOR: YELLOW; COLOR: BLUE;">

                     Plants are essential for the survival of life on
                     Earth, as they provide oxygen, food and shelter.                                  To refresh the
                                                                                               Short key
                     </P>                                                                               web page:

                     </BODY>                                                                            Ctrl  +  R

                     </HTML>

                     INTERNAL CSS

                     Internal CSS is written inside the <STYLE> tag in the <HEAD> section. Styles apply to all elements
                     of the same type.
                     For example, a style for <H1> affects all <H1> headings on the page.

                     The syntax to define internal CSS is as follows:
                                                                                        CSS is like the colour and
                     <HEAD>
                                                                                        texture of a flower or leaf,
                     <STYLE>
                                                                                       which enhances the plant’s
                     SELECTOR { PROPERTY: VALUE; }                                            visual appeal.
                     </STYLE>

                     </HEAD>

                        Code     Write the HTML code to present the given web page using internal CSS.
                          2

                     <!DOCTYPE HTML>
                     <HTML>

                     <HEAD>
                     <TITLE>Internal CSS</TITLE>

                     <STYLE>
                     BODY {

                     BACKGROUND-COLOR: LIGHTGREEN; }
                     H1 { COLOR: BROWN; TEXT-ALIGN: CENTER; }

                     P { COLOR: BLUE; }
                     </STYLE>

                     </HEAD>
                     <BODY>

                     <H1>Water Conservation</H1>
                     <P>We should conserve water to protect our planet. Every drop matters
                     and every effort creates an impact.

                                                                                                   CSS3–Styling Basics  95

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