HTML for People Who Want to Learn  --  HTML for Starters

Paragraphs

You cannot enter a hard return like you would in a word processor to put blank lines in-between paragraphs in your Web page. While writing the document, you can hit the return key as many times as you want, but browsers will ignore the hard returns and simply render a single space. Therefore, you must use the paragraph tag. The <P> tag separates individual paragraphs in a document, and leaves a blank line in-between paragraphs.


Type your paragraphs like this: And they will appear like this:
<P>This represents the first paragraph. This can be any part of your document.</P>
<P>This represents the second paragraph. This can be any part of your document.</P>

This represents the first paragraph. This can be any part of your document.

This represents the second paragraph. This can be any part of your document.

The paragraph tag does not need a closing tag (</P>). The closing tag is required only when any of the attributes of the paragraph tag are used.

 

Attributes of the paragraph tag

<P ALIGN=LEFT>
Using this attribute, the paragraph will be aligned against the left side of the browser window. You probably will not use this attribute often, because it is the default value.

<P ALIGN=CENTER>
The paragraph will be centered on the screen when this attribute is used.

<P ALIGN=RIGHT>
You guessed it. This will align the paragraph against the right side of the browser window.

<P ALIGN=JUSTIFY>
This aligns the text against both the left and right margin. In other words, it either expands the text or squishes the text on a line so that there won't be a jagged edge on the right side of the paragraph. Not all browsers accept this attribute.

 


 

Line Breaks

The line break tag (<BR>) is similar to a hard return in a word processor in that the line break tag forces a line break without adding any blank space in-between the lines. Line breaks could be used for writing postal addresses or just anytime you want to put the text or an object on the next line.

 

You can type this:

HTML for People<BR>Who Want to Learn<BR>2823 Vista<BR>SiliconValley, GeoCities


The result will be:

HTML for People
Who Want to Learn
2823 Vista
SiliconValley, GeoCities


The BR element does not have a closing tag.

 


Back to Chaper 1
HTML for Starters
E-mail
Next: Chapter 3

Last Modified: Saturday, 18-Jul-98 21:49:36 PDT
Page URL: http://geocities.datacellar.net/SiliconValley/Vista/2823/text/htmlchp2.html

1