Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 129 - 2612 Digimind C6
P. 129

    HTML5 provides various methods to format text on a web page and makes it easy to alter the
                     style of individual elements on a web page. CSS is a convenient method of style the elements of
                     a web page. 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 web page elements such as
                     paragraphs, lists, backgrounds, etc.

                     Every web page 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

                                                                        Specifies the text colour to be used on the
                      color                    Name of the colour
                                                                        web page.
                                               left, right, center,
                      text-align                                        Specifies the alignment of the text.
                                               justify
                                               length in pixels or      Specifies the indentation of the first line of the
                      text-indent
                                               percentage               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 web page 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 Web Page  127

| 124 125 126 127 128 129 130 131 132 133 134 |