Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

Preformatted Text 129

7


Output ▼


When you’re creating text for the

 tag, you can use link tags and character styles
but not element tags such as headings or paragraphs. You should break your lines with
hard returns and try to keep your lines to 60 characters or fewer. Some browsers might
have limited horizontal space in which to display text. Because browsers usually won’t
reformat preformatted text to fit that space, you should make sure that you keep your text
within the boundaries to prevent your readers from having to scroll from side to side.


Be careful with tabs in preformatted text. The actual number of characters for each tab
stop varies from browser to browser. One browser might have tab stops at every fourth
character, whereas another may have them at every eighth character. You should convert
any tabs in your preformatted text to spaces so that your formatting isn’t messed up if it’s
viewed with different tab settings than in the program you used to enter the text.


The

 tag is also excellent for converting files that were originally in some sort of
text-only form, such as email messages, into HTML quickly and easily. Just surround the
entire content of the message within
 tags and you have instant HTML, as in the
following example:



To: [email protected]
From: [email protected]
Subject: Tales of the Move From Hell, pt. 1

I spent the day on the phone today with the entire household
services division of northern California, turning off services,
turning on services, transferring services and other such fun
things you have to do when you move.


It used to be you just called these people and got put on hold for
an interminable amount of time, maybe with some nice music, and
then you got a customer representative who was surly and hard of


FIGURE 7.3
A table created
using

,
shown in a
browser.

Free download pdf