Lesson 7:HTML Paragraphs
- Monday, February 2, 2009, 13:58
- Programming
- 533 views
- Add a comment
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.
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.
Hope this tutorial will help you to learn the concept and use of HTML paragraph tag for more tutorial keep in touch.
About the Author
Related Tutorials & Articles
Web pages contains series of contents line or pages, its very difficult for the user to differentiate different section of the contents because all the text formatting is same. HTML support hot feature of heading, there are six heading element <H1></H1>….<H6></H6>. By using different level of tags document creator can show different section within the same...Read more
The <HR> element in html create an horizontal line or rule across the screen. <HR> is called an empty tag, although it have four attribute to change default way the rule appears on screen. This tag is called an empty tag because there is not ending tag or closing tag. Look at the simple use...Read more
HTML is capable to embed images in a webpage; it can be done by using html tag <img>. Image tag is not a container tag means there is no closing tag but it has several attributes. Tag Syntax <img src=”picpath” height=”10” width=”20” alt=”image description” align=> Src Src attribute of image tag defines source of image, src is always set...Read more
Comment tag is ignored by the browser and it’s invisible to the browser. The purpose of comment tag to facilitate the author for entering the details of tags and document.As you write you web page it is important to add comments that identify who created it,when it was created and,where appropriate,brief explanation of why you...Read more
In lesson 1 we have seen that head and body portion contents are shown together on body part of the document. In this tutorials we will see how to use the title tag to show the head part separate from the body part. Let me show you the document which were used in lesson 1 for...Read more
Write a Comment
Gravatars are small images that can show your personality. You can get your gravatar for free today!























