Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 78 - 2629_Devagiri_C-7
P. 78

    BODY {BACKGROUND-COLOR: LIGHTBLUE;}

                      H1 {COLOR: FORESTGREEN; BACKGROUND-COLOR: HONEYDEW; }
                      P {COLOR: BLUE; BACKGROUND-COLOR: LIGHTGREEN;}

                      Now, save the file with the name style.css in the same location as your HTML file. If the file is saved
                      in a different location than the HTML file, you need to specify the complete or absolute path. Open
                      a new Notepad window and type the following code:

                      <!DOCTYPE HTML>

                      <HTML>
                      <HEAD>

                      <TITLE>External CSS</TITLE>
                      <LINK REL="STYLESHEET" TYPE="TEXT/CSS"

                      HREF="style.css">
                      </HEAD>

                      <BODY>
                      <H1>Importance of Recycling</H1>

                      <P>Recycling helps conserve natural resources, save energy and reduce
                      pollution. It is essential for a sustainable future. </P>

                      </BODY>

                      </HTML>
                      You can use 6-digit hex codes for colours, e.g., #000000 for black and #FFFFFF for white.

                      In CSS, the priority order is: inline > internal > external. This means that if you specify inline, internal
                      and external CSS for an element, the inline CSS will be applied first, followed by internal CSS and
                      then external CSS.

                          You can easily find the colour codes by simply searching colour picker on Google. Then, select the
                                                   appropriate colour according to your needs.

                       RAPID RECALL                             Tick ( ) if you know this.

                          1.  CSS eliminates the need to repeat code in every HTML tag.

                          2.  A combination of a property and its value is called a Declaration.

                       76
                            Premium Edition-VII

| 73 74 75 76 77 78 79 80 81 82 83 |