Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 30 - 2606_PlugGPT_C6_Flipbook
P. 30

    The selector specifies the element to which we want to apply the formatting and the declaration
                      specifies the formatting to the selector.
                         The property of CSS is used to create a style.
                         Value is the valid value for the property.
                          A semicolon should be used at the end of the property-value pair, if more than one property is
                        used.

                      Some of the properties and their values of CSS are given below:

                             Property                       Value                               Description

                       Background-Color       Name of the colour                  Specifies background colour.

                                                                                  Specifies the text colour used in the
                       Color                  Name of the colour
                                                                                  webpage.
                       Text-Align             Left, Right, Center, Justified      Specifies the alignment of the text.

                                                                                  Specifies the font of the text used in the
                       Font-Family            Name of the font
                                                                                  webpage.
                                              Value is given in Pixels. The default   Specifies the font size used in the
                       Font-Size
                                              font size for the text is 16px.     webpage.

                      The three ways to use CSS in HTML documents are described below:

                      INLINE CSS
                      An inline style 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. Syntax to use the style attribute with a tag:

                                                  <TAGNAME STYLE = “PROPERTY:VALUE;”>
                      For Example:
                      <BODY STYLE=”BACKGROUND-COLOR:RED; COLOR:RED”>
                      TEXT IN RED COLOUR
                      </BODY>

                      INTERNAL CSS

                      Internal CSS allows us to define the style for a single HTML page. It is defined using the <STYLE>
                      tag in the head section of the HTML page. For Example:
                      <!DOCTYPE HTML>
                      <HTML>
                      <HEAD>
                      <STYLE>
                      H1 {COLOR:RED;}
                      H2 {COLOR:GREEN;}
                      </STYLE>                                        Primary language for webpage designing
                      </HEAD>
                      <BODY>
                      <H1>This is a heading level 1 (H1)</H1>

                       28   Premium Edition-VI                                                                                                                                                                              Learn HTML5 and CSS3  29

| 25 26 27 28 29 30 31 32 33 34 35 |