Basic Guide For Writing Web Pages -- Introduction / Table Of Contents / Previous Page / Next Page

Basic Web Page Writing Step 3
Formatting Text


In step 2 you added text to your web page. In this step you will format the text into lines and paragraphs and also see how to place text exactly the way you want it to look on your page.
In step 2 you saw that no matter how you typed your text into the page it always looked the same because no tags were used to tell the browser what you wanted. Since Web Browsers ignore carriage returns and line feeds you must give specific instructions or the text will be the line length of the browser you use to view it. There are three basic tags that will make text appear the way you want it to instead of one long paragraph. These are the line break <br>, the paragraph <p> and the pre format <pre>.

The Line Break

The Line break ( line break <br>) tells the browser to end one line and continue on the next line. See the samples:

Using the Line Break Tag

This section is typed using the LINE BREAK Tag. <br>
The second line is created by the Line Break Tag.

Not Using the Line Break Tag

This is what it would look like without the line break tag used. Both sentences would be continued on the same line.

The Paragraph

The Paragraph ( paragraph <p> ) is similar to the Line Break with one exception. It not only ends one line and continues on another, it also skips a line before starting the next line. See the sample:

Using the Paragraph Tag

With a Paragraph Tag used, you can leave a space between lines or leave blank lines.<p>

This second line has a blank line before it.

NOTE: The <br> and the <p> don't need an end tag, however, using a </p> will allow you to center a paragraph which you will see in another lesson.

Using the Pre Format Tag

There are times when you would like the text to appear just the way you typed it. This can be done by using the <pre> at the beginning of the section of text you want to format and </pre> tag at the end. Your text will appear just the way you typed it including line feeds, tabs, spacing, etc. You do not need to use the <br> or <p> tags in this case.

See Sample below.

<pre>
This is typed inside the pre format tags.
		Since the Pre Format Tag allows you to have text 
				Appear anyway you want,

		You can place text anywhere in the page you like.
Even              with               lots                of                     spaces                    between                 words.
</pre>

Try using these tags in your own page. Open your webpage.htm and try these out. If you forgot how to use the browser to view the page, return to Step 2 to review.


You now know how to format text so that it looks just the way you want it to appear on your page. In step 4 you will see how Headers can make sections of the text stand out.

STEP 4 -- Headers



Basic Guide For Writing Web Pages -- Introduction / Table Of Contents / Previous Page / Next Page

created by Larry Curreri,

© 1996 l_curreri@yahoo.com
Visit My Home Page

last modified: January 14, 2002

This page hosted by Get your own Free Home Page