How To Write A Paragarphs in HTML

admin_img Posted By Bajarangi soft , Posted On 29-09-2020

The HTML <p> element defines a paragraph. A paragraph always starts on a new line, and browsers automatically add some white space (a margin) before and after a paragraph,The browser will automatically remove any extra spaces and lines when the page is displayed,hr defines horizantal rules,br defines line breaks,The text inside a 'pre' element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks:

Html paragraphs

1.HTML Paragraphs 

<!DOCTYPE html>
<html>
<head><title>html paragraphs</title></head>
<body>

<p>Hello Goodmorning.</p>
<p>Hello Goodafternoon.</p>
<p>Hello Goodnight.</p>

</body>
</html>

 2.How It Displays in HTML Page

<html>
<head>
<title>html paragraphs</title>
</head>
<body
<p>
This paragraph
contains a lot of lines
in the source code,
but the browser 
ignores it.
</p>

<p>
This paragraph
contains      a lot of spaces
in the source     code,
but the    browser 
ignores it.
</p>

<p>
The number of lines in a paragraph depends on the size of the browser window. If you resize the browser window, the number of lines in this paragraph will change.
</p>

</body>
</html>

3.HTML Paragraphs Horizantal Rules
 

<!DOCTYPE html>
<html>
<head><title>horizantal rules</title></head>


<body>
<h1>Hello <br>Goodmorning</h1>
<p>Have a nice day.</p>
<hr>

<h2>Hello goodafternoon</h2>
<p>Have a nice day.</p>
<hr>

<h2>Hello Goodnight</h2>
<p>Have a sweet dreams.</p>

</body>
</html>

 

4.HTML Pre Element

<!DOCTYPE html>
<html>
<body>

<p>The pre tag preserves both spaces and line breaks:</p>

<pre>
   Bajarangi software solutions.

    Bajarangi software solutions.

    Bajarangi software solutions.
   
     Bajarangi software solutions..
</pre>

</body>
</html>

Related Post