Page 79 - TP_Play_V2.1_class6
P. 79

background colour in a web page, then you need to use the background-color property of CSS

                 in the following manner:
                 body {background-color:green}
                 In  the  preceding  code,  body  signifies  the  <BODY>  tag,  background-color  is  the  property

                 and green is the value of property that will change the background colour of the web page as
                 green.
                 Using CSS Style


                 There are three ways to use the CSS styles in HTML document which are:
                    Inline style sheet

                    Internal Style Sheet

                    External Style Sheet
                 Inline Style Sheet

                 An inline style is used to apply a unique style for a single element. The style attribute allows you
                 to create and apply a style on the element. Syntax to create an inline style is:

                 <element style = "property1:value1; property2:value2; … ….">
                 where the element is any valid HTML tag and style is the global attribute of HTML used by

                 all the tags in HTML. The style attribute contains the CSS properties and their values within
                 double-quotes. For example:
                 <body style="background-color:green; color:white">

                 Text in white colour

                 </body>
                 Internal Style Sheet

                 CSS design can also be applied into an HTML document by using <STYLE> tag. This tag should
                 be placed inside the <HEAD> and </HEAD> tags. An internal style sheet is commonly used

                 when one web page has a unique style. For example:
                 <head>

                 <style>

                 body{background-color:green; color:white;}

                 </style>
                 </head>                                                      CSS is like the color and texture of

                                                                              a flower or leaf, which enhances the
                 <body>
                                                                                     plant's visual appeal.
                 Text in white colour

                 </body>




                                                                            Introduction to HTML5 and CSS3        77
   74   75   76   77   78   79   80   81   82   83   84