Site icon TestingDocs.com

HTML Paragraph

Overview

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 that are separated from adjacent blocks through blank lines, a style sheet, etc.

Syntax

Start tag : <p>

End tag : </p>

We can start a new paragraph with the <p> tag and to end the paragraph we use </p> tag.

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 the headings tag to create titles for the paragraphs.

</p>

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 divided long 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 along 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

Exit mobile version