4. Text FormattingIn Chapter 1, you have seen that the <b> tag can make text bold. The effects of other tags are demonstrated in the following example. bold emphasized strong italic THEsuperscript THEsubscript
computer variable
inserted BlockquoteThe This is the text WITHOUT blockquote. This is the text WITHOUT blockquote. This is the text WITHOUT blockquote. This is the text WITHOUT blockquote.
Spaces and Line BreaksBy default, the browser condenses multiple spaces into one and removes line breaks of a plain text. To add spaces, you may use the code . One represents one space. To add a line break, use the tag <br />. Note that the Spaces and line breaks are commonly used in formatting poetry. The following is an example from Edgar Allan Poe's Annabel Lee. It was many and many a year ago,
Preformatted TextThe tag for preformatted text is <pre>, which is used to preserve both spaces and line breaks. The above poem can also be coded as: It was many and many a year ago, In a kingdom by the sea, That a maiden there lived whom you may know By the name of Annabel Lee; And this maiden she lived with no other thought Than to love and be loved by me. Apparently, using <pre> is much simpler than and <br />. However, the Fortunately, the newest version of Cascading Style Sheet, CSS3, has introduced a style property that can solve this problem (see Chapter 9).
|