Lesson 7:HTML Paragraphs

When writing a report or article, you divided the text into section called paragraphs. Paragraph is the continuous break commonly used for better representation for the reader. To start new paragraph you need to insert a blank line and start the new line with tab, that can be done by using(<BR>)line break but still you have to work hard for inserting tabs for the extra space.

There is an easy way out for paragraph in HTML document. HTML support <P> container divided the text in small continuous sections. Each paragraph is started with starting <P> tag and end with </P> tag. It is important to use pair of <P></P> for one paragraph if tag is not closed then it will considered as the same paragraph.

Let’s take an easy example to understand the concept of paragraphs in HTML.

<HTML>
<HEAD>
<TITLE>
PARAGRAPHS
</TITLE>
</HEAD>
<BODY>
<P>
Rank: 1 (Previous rank: 1) CEO: H. Lee Scott Jr. Employees: 2,055,000 Address: 702 S.W. Eighth St. Bentonville, Arkansas  72716 Country: U.S. Website: www.walmartstores.com
</P>
Wal-Mart last year number one company retaining its position on top, retail giant providing friendly environment to employees. The company expanded his health plan from employee to 94% as compared to the last year 90%
</BODY>
</HTML>

The Output of this html document on browser is shown below in the figure, pair of paragraph tag separate second section form first section.

image

Alignment Attribute in Paragraph

HTML paragraphs tag also support alignment attribute to change the default format of paragraph, by default paragraph is left aligned other than that right and center alignment value can be place for align attribute.

For better understand please go through the below example.

<HTML>
<HEAD>
<TITLE>
PARAGRAPHS
</TITLE>
</HEAD>
<BODY>
<P align=”center”>
Rank: 1 (Previous rank: 1) CEO: H. Lee Scott Jr. Employees: 2,055,000 Address: 702 S.W. Eighth St. Bentonville, Arkansas  72716 Country: U.S. Website: www.walmartstores.com
</P>
<P align=”right”>
Wal-Mart last year number one company retaining its position on top, retail giant providing friendly environment to employees. The company expanded his health plan from employee to 94% as compared to the last year 90%
</P>
</BODY>
</HTML>

The output of the above code in Internet explorer shown below. First paragraph is center aligned and second paragraph is right aligned, the reason to not show the use of left align because paragraph tags use left align by default.

image 

Hope this tutorial will help you to learn the concept and use of HTML paragraph tag for more tutorial keep in touch.

 

 

Be Sociable, Share!

Leave a Reply