HTML Paragraph
HTML Paragraph
In this tutorial, we will learn about HTML Paragraph tags. We use <p> tag to create a paragraph in the document. We can structure the text in the HTML document into different paragraphs with the <p> tag.
Paragraphs are represented as blocks of text separated from adjacent blocks through blank lines, a style sheet, etc.
Syntax
The general syntax of the paragraph text in an HTML document is as follows:
<p> …. </p>
We can start a new paragraph with the <p> tag, and to end the paragraph, we use the </p> tag.
Start tag: <p>
End tag: </p>
For example:
<p>
This is a sample text in the web document. We can divide the long text into multiple sub-sections using the paragraph tag. We can also add a heading tag to create titles for the paragraphs.
</p>
<pre> …</pre> is used to indicate preformatted text.
Example
<html>
<!--
####################################
# HTML Paragraphs Demo
####################################
-->
<head>
<title> HTML Tutorials - HTML Paragraph</title>
</head>
<body>
<h1> H1 Heading </h1>
<p>
This is a sample paragraph text in an HTML document. We can
divide long text into multiple sub-sections using the paragraph
tag. We can also add the headings tag to create titles for the
paragraphs.
</p>
<h3> H3 Heading </h3>
<p>
This is another paragraph in the HTML document. This paragraph
has h3 heading. We can mix other tags with the paragraph to
present nice readable content to the web page reader.
</p>
</body>
</html>
Sample Output
Save the file in *.html or *.htm format. Open the page in the web browser to see the output.
We can also use other tags inside the <p> tag. For example, we will use <strong> tag to highlight the important text in the paragraph.
<p>
This is a sample paragraph text in an HTML document. <strong> This text in important text in the paragraph. </strong>
</p>
—
HTML Tutorials
HTML Tutorials on this website:
https://www.testingdocs.com/html-tutorials/
More Information on HTML:
https://www.w3.org/TR/html401/intro/intro.html