Page 38 - 2606_PlugGPT_C6_Flipbook
P. 38

HTML5 provides various methods to format text on a webpage and makes it easy to alter the
                  style of individual elements on a webpage. Cascading Style Sheets (CSS) is a convenient method
                  of style the elements of a webpage. It controls various elements like the colour, font, text size,
                  etc. within a single page or the entire website. CSS can also be used to change the look of any
                  webpage elements such as paragraphs, lists, backgrounds, etc.
                  Every webpage on a website can be linked to a single style sheet, hence, any change made to the
                  style sheet formatting affects every HTML document linked to the sheet. We can use a style sheet
                  as a template by storing all the information in one place and easily change the appearance of our
                  site in one go, thus saving a lot of time in case your site has numerous pages.



                            TEXT PROPERTIES


                  Text properties are used to change the appearance of the text. The text properties and their
                  values used with the style attribute are given below:



                         Property                      Value                               Description



                                         Name of the colour                 Specifies the text colour to be used on
                   color
                                         Example: red, #FF0000              the webpage.

                   text-align            left, right, center, justify       Specifies the alignment of the text.

                                         length in pixels or percentage     Specifies the indentation of the first
                   text-indent
                                         like 20px, 10%                     line of the text.

                                         underline, overline or             Specifies the text effects like underline,
                   text-decoration
                                         linethrough                        overline or linethrough.


                                         capitalise, uppercase,             Specifies the transformation of text into
                   text-transform
                                         lowercase and none                 uppercase, lowercase or title case.


                  Create an HTML webpage by using the text properties.

                  <!DOCTYPE html>
                  <HTML>
                  <HEAD> <TITLE>Text Properties</TITLE>
                  <STYLE>
                  H1{font-family:"Comic Sans MS"; text-align:center;
                  text-decoration:underline;color:red}
                  </STYLE>
                  </HEAD>
                  <BODY>

                  <H1>Energy</H1>


                   36   Premium Edition-VI
   33   34   35   36   37   38   39   40   41   42   43