Header Ads Widget

What Is HTML Paragraph | HTML Paragraph | HTML Tutorial Class 5 | HTML Basic Code | Learn HTML Coding

HTML Tutorial Class 5 paragraphs

HTML Paragraph:-

A Paragraph always starts from the new line and it is usually a bloke of text. in an article can be more than one Paragraph.

<p> tag defines the Paragraph. A Paragraph always starts from the new line the browser automatically adds some space (a margin) before and after a paragraph.

If you don't know about HTML Headings click on the link and learn first HTML Headings and then learn HTML Paragraphs.


<!DOCTYPE html>

<html>

<body>

<p> This is a paragraph </p>

</body>

</html>

Try this code for a better experience


HTML Display:-

You can not be sure how the HTML will be displayed.

Large or small screens and resized windows will create different results.

With HTML you can not change the display by adding extra spaces or extra lines in your HTML code.

The browser will remove extra spaces and extra lines automatically when your will is displayed.


<!DOCTYPE html>

<html>

<body>

<p> This is a paragraph. In this paragraph, you will see the line break

but the browser will not accept it they will not show a line break. </p>

<p> This is another paragraph. In this, you will see the gap between the words but the browser will remove this gap automatically when you will see this paragraph on your screen the browser will not show the gap between the words. </p>

</body>

</html>

Try this code for a better experience


HTML Horizental Rule:-

The <hr> tag defines the thematic break in an HTML page, and it is most often displayed as a horizontal rule.

The <hr> tag is used to separate content or show any change in your web page.


<!DOCTYPE html>

<html>

<body>

<h1> This is h1 heading </h1>

<p> This is a paragraph </p>

<hr>

<h2> This is h2 heading </h2>

<p> This is another paragraph </p>

<hr>

<h3> This is h3 heading </h3>

<p> This is another one paragraph </p>

</body>

</html>

Try this code for a better experience


NOTE:- <hr> tag is empty tag it means <hr> tag has no end tag.


HTML Line Break:-

In HTML <br> tag is used only for line breaks. Where you want to break any line, not text you should have to use <br> tag.


<!DOCTYPE html>

<html>

<body>

<p> This is a paragraph with a line break <br> new line starts from here <br> another new line starts from here.

</body>

</html>

Try this code for a better experience


NOTE:- The <br> tag is also an empty tag like the <hr> tag, empty means the <br> tag has no end tag.


HTML Poem Problem:-

The poem will be displayed in one line.


<!DOCTYPE html>

<html>

<body>

<p> In this poem you will see the poem is displayed in a line, not different lines. </p>

<p> My cat lies over the river. 

       my cat lies over the river. 

       my cat lies over the river. 

       oh, bring back my cat to me.

</p>

</body>

</html>

Try this code for a better experience


Solution-The HTML <pre> tag:-

The HTML <pre> tag defines preformatted text. It means that you will write inside the <pre> tag that will be displayed as it is on your screen.


<!DOCTYPE html>

<html>

<body>

<p> In this you will see the poem will display, what you want or what you will write. </p>

<pre> My cat lies over the river. 

           my cat lies over the river. 

          my cat lies over the river. 

          oh, bring back my cat to me.

</pre>

</body>

</html>

Try this code for a better experience

Post a Comment

0 Comments