XHTML - SPLessons
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

XHTML Text

XHTML Text

shape Introduction

This chapter demonstrates about the XHTML Text. User can use the different types of text to build the different documents following are the concepts are covered in this chapter.
  • Adjusting Font Sizes
  • Text Alignment

Adjusting Font Sizes

shape Description

User most likely need the title of the Book to seem bigger than whatever remains of the text. Like a Word Processor's report, User should set fonts to the particular fonts, but which is not the favoured strategy for Book organizing. Since each eReading gadget have some default font size which is defined by the user, User do not to modify default size taking into account what user can feel is ideal. Which is much more user-friendly to derive the font size based on its relative size of based on the relative size of the users. Theoretically, User might want the title of the text to be the twice as large as the body of the text. In order To change the style value, user can use the "em" scale.Font size should be 1.0em is the base font size characterized by eReading gadget. By utilizing diverse numbers of ems (1.0em=base size, 2.0em=double size or 200%, 0.5em=half size or 50%, and so on.), User can change the look of users eBooks without meddling with the users default settings on which eReader. Utilizing the em scale is defined as relative measuring. The code below demonstrates the different font size for the title and body of the text. [html] <!DOCTYPE html> <html> <body> <p style="font-size: 2em; font-weight: bold;">XHTML</p> <p style="font-style: italic;">SPLessons</p> <p style="text-decoration: underline;">splessons Copyright Info</p> </body> </html> [/html] Result By running the above code in a preferred browser user can get the following output as shown in below image.  

Text Alignment

shape Description

There are four alternatives to adjust the text those are the right, left, centre, and justify. Left avocation have a worn out of right edge, while supported justification makes the right edge and left edges of the content line up vertically. For paragraphs such as chapter headings, title, and the section breaks, user most likely need centred text. The code below demonstrates the text alignment as shown below. [html] <!DOCTYPE html> <html> <body> <p style="text-align: left; font-weight: bold;">XHTML</p> <p style="text-align: center; font-style: italic;">SPLessons</p> <p style="text-align: right; text-decoration: underline;">splessons Copyright Info</p> </body> </html> [/html] Result By running the above code in a preferred browser user can get the following output as shown in below image. <div>, <p>, and <span> Hierarchy The <div>, <p>, and <span> tags all swap around content in XHTML and which permit style properties to be included then eReader and web browser also know how to show the text. Which tags are utilized over various sizes of text as follows. <div> tag is used to apply styles to the multiple paragraphs without any changes to the style property in each individual <p> tag. The code below demonstrates the XHTML hierarchy as shown. [html] <!DOCTYPE html> <html> <body> <div style="font-weight: bold; text-align: right;"> <p style="text-align: left;">SPLessons:</p> <p>Visit <span style="font-weight: normal;">SPLESSONS</span> web site for simple programming lessons.</p> </div> </body> </html> [/html] Result By running the above code in a preferred browser user can get the following output as shown in below image.

Summary

shape Key Points

  • User can arrange the text by using text alignment.
  • <div> style can be applied to the multiple paragraph at a time.
  • User can adjust the different font sizes.