Paragraphs HTML or Html5 | How HTML Handles Paragraphs

How Paragraphs HTML and HTML5 are used?

The Paragraph is one of the mostly used HTML tags. It is block level tag we will discuss what the block level elements and what are the inline elements later. For now you can imagine that the block level elements are the elements which contain different parts of an HTML page.

The paragraphs are used in HTML language to display text on a web page. They are used in HTML document by <p> and </p> tags. They were usually managed with attributes before but now different attributes are considered obsolete and CSS is used instead. To more illustrate see the code bellow.

<!DOCTYPE html>

<!– www.howtocode.pk is one of the leading Web development tutorial Site. –>

<html>

<head>

<title>

Paragraph Example From howtocode.pk

</title>

</head>

<body>

<p>

Paragraphs hold the text usually that is formatted like a sequence of words with blank space or margin or padding in them separating each other.

</p>

<p>

Lorem ipsum dolor sit amet, consectetur adipiscing elit. In in risus lacus. In auctor orci id tortor viverra nec consectetur

eros rhoncus. Vivamus elementum velit arcu, ac porta risus. Quisque ut est vitae dolor tempus adipiscing. Ut mauris quam,

malesuada non laoreet ac, elementum vel enim. Nulla auctor congue accumsan. Pellentesque habitant morbi tristique senectus et

netus et malesuada fames ac turpis egestas. Aliquam adipiscing facilisis nibh consectetur fermentum. Phasellus egestas bibendum

suscipit. Curabitur est dolor, ultrices quis aliquet sit amet, rhoncus nec nisi. Integer dictum diam sit amet enim dapibus

adipiscing. Ut sit amet mauris sit amet odio malesuada lacinia. Praesent ac nunc arcu, et eleifend odio.

</p>

</body>

</html>

Output:

Paragraphs hold the text usually that is formatted like a squence of words with blank space or margin or padding in them seperating each other.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. In in risus lacus. In auctor orci id tortor viverra nec consectetur eros rhoncus. Vivamus elementum velit arcu, ac porta risus. Quisque ut est vitae dolor tempus adipiscing. Ut mauris quam, malesuada non laoreet ac, elementum vel enim. Nulla auctor congue accumsan. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam adipiscing facilisis nibh consectetur fermentum. Phasellus egestas bibendum suscipit. Curabitur est dolor, ultrices quis aliquet sit amet, rhoncus nec nisi. Integer dictum diam sit amet enim dapibus adipiscing. Ut sit amet mauris sit amet odio malesuada lacinia. Praesent ac nunc arcu, et eleifend odio.

 

In the code above we have two paragraphs in the <body> tag. You can see the output that how they are separated by the browser. It may be deferent in a deferent browser. As a developer you should tell the browser that what should be the setting a paragraph. This is that you can learn from experience. Many browsers handle the text which is not in any tag, as a paragraph but for better control of the text you should always use it in some tag like a paragraph tag.

Now you can apply deferent styles on a paragraph by using the old way by placing attributes in the <p> tag. This is not recommended infact it is not commonly used in modern HTML. These attributes are now replaced by the CSS styles. For example here are the attributes that were used in Html to format a paragraph. To align the paragraph text to right.

<p>

Paragraphs hold the text usually that is formatted like a squence of words with blank space or margin or padding in them    seperating each other.

</p>

 

<p align=”right”>

Lorem ipsum dolor sit amet, consectetur adipiscing elit. In in risus lacus. In auctor orci id tortor viverra nec consectetur

eros rhoncus. Vivamus elementum velit arcu, ac porta risus. Quisque ut est vitae dolor tempus adipiscing. Ut mauris quam,

malesuada non laoreet ac, elementum vel enim. Nulla auctor congue accumsan. Pellentesque habitant morbi tristique senectus et

netus et malesuada fames ac turpis egestas. Aliquam adipiscing facilisis nibh consectetur fermentum. Phasellus egestas bibendum

suscipit. Curabitur est dolor, ultrices quis aliquet sit amet, rhoncus nec nisi. Integer dictum diam sit amet enim dapibus

adipiscing. Ut sit amet mauris sit amet odio malesuada lacinia. Praesent ac nunc arcu, et eleifend odio.

</p>

Output:

Paragraphs hold the text usually that is formatted like a squence of words with blank space or margin or padding in them seperating each other.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. In in risus lacus. In auctor orci id tortor viverra nec consectetur eros rhoncus. Vivamus elementum velit arcu, ac porta risus. Quisque ut est vitae dolor tempus adipiscing. Ut mauris quam, malesuada non laoreet ac, elementum vel enim. Nulla auctor congue accumsan. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam adipiscing facilisis nibh consectetur fermentum. Phasellus egestas bibendum suscipit. Curabitur est dolor, ultrices quis aliquet sit amet, rhoncus nec nisi. Integer dictum diam sit amet enim dapibus adipiscing. Ut sit amet mauris sit amet odio malesuada lacinia. Praesent ac nunc arcu, et eleifend odio.

Paragraph’s attribute can easily be replaced by the CSS style and the effect will be same. We will discuss more about CSS in the CSS chapter.

Comments