Page 85 - Trackpad_V2.1_Class6
P. 85

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
                                        strikethrough                      overline or strikethrough.


                                        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>


                                                                                            Formatting a Webpage  83
   80   81   82   83   84   85   86   87   88   89   90