HTML Class 4 | paragraph Element

HTML Paragraph Element: <p>


To create a paragraph, simply type in the <p> element with its opening and closing tags:

<!DOCTYPE html><html>
<head>
<title>first page</title>
</head>
<body>
<p>This is a paragraph. </p>
<p>This is another paragraph. </p>
</body>
</html>

Output :
awc html course w3school
Single Line Break Tag in HTML:

Use the <br /> tag to add a single line of text without starting a new paragraph:

<html>
<head>
<title>first page</title>
</head>
<body>
<p>This is a paragraph.</p>
<p>This is another paragraph. </p>
<p>This is <br /> a line break </p>
</body>
</html>

HTML Single Line Break:

Opening the HTML file in the browser shows that a single line break has been added to the paragraph:
The <br /> element has no end tag.  

HTML <pre> Element :

The HTML <pre> element defines preformatted text.
The text inside a <pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks:
awc services with w3school
<html>
<head>
<title>first page</title>
</head>
<body>
<p>This is a paragraph. </p>
<pre>
  My Bonnie lies over the ocean.

  My Bonnie lies over the sea.

  My Bonnie lies over the ocean.

  Oh, bring back my Bonnie to me.
</pre> </body></html>

What is the correct HTML element for inserting a line break?

Post a Comment

0 Comments